Git Product home page Git Product logo

bimap-rs's Introduction

bimap-rs

version documentation license

bimap-rs is a pure Rust library for dealing with bijective maps, aiming to feel like an extension of the standard library's data structures whenever possible. There are no external dependencies by default but Serde and no_std compatibility are available through feature flags.

  1. Quick start
  2. Feature flags
  3. Documentation
  4. Contributing
  5. Semantic versioning
  6. Minimum supported Rust version
  7. License

Quick start

To use the latest version of bimap-rs with the default features, add this to your project's Cargo.toml file:

[dependencies]
bimap = "0.6.3"

You can now run the bimap-rs Hello World!

fn main() {
    // A bijective map between letters of the English alphabet and their positions.
    let mut alphabet = bimap::BiMap::<char, u8>::new();

    alphabet.insert('A', 1);
    // ...
    alphabet.insert('Z', 26);

    println!("A is at position {}", alphabet.get_by_left(&'A').unwrap());
    println!("{} is at position 26", alphabet.get_by_right(&26).unwrap());
}

Feature flags

Flag name Description Enabled by default?
std Standard library usage (HashMap) yes
serde (De)serialization using Serde no

This Cargo.toml shows how these features can be enabled and disabled.

[dependencies]
# I just want to use `bimap-rs`.
bimap = "0.6.3"

# I want to use `bimap-rs` without the Rust standard library.
bimap = { version = "0.6.3", default-features = false }

# I want to use `bimap-rs` with Serde support.
bimap = { version = "0.6.3", features = ["serde"] }

Documentation

Documentation for the latest version of bimap-rs is available on docs.rs.

Contributing

Thank you for your interest in improving bimap-rs! Please read the code of conduct and the contributing guidelines before submitting an issue or opening a pull request.

Semantic versioning

bimap-rs adheres to the de-facto Rust variety of Semantic Versioning.

Minimum supported Rust version

bimap MSRV
v0.6.3 1.56.1
v0.6.2 1.56.1
v0.6.1 1.42.0
v0.6.0 1.38.0
v0.5.3 1.38.0
v0.5.2 1.38.0
v0.5.1 1.38.0
v0.5.0 1.38.0
v0.4.0 1.38.0

License

bimap-rs is dual-licensed under the Apache License and the MIT License. As a library user, this means that you are free to choose either license when using bimap-rs. As a library contributor, this means that any work you contribute to bimap-rs will be similarly dual-licensed.

bimap-rs's People

Contributors

alessiozanga avatar atomicky avatar badel2 avatar billyrieger avatar cbeuw avatar dmarcuse avatar drahnr avatar futpib avatar nw0 avatar raoulhc avatar rob9315 avatar xaeroxe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.