isomorphism

Crates.ioisomorphism
lib.rsisomorphism
version0.1.3
sourcesrc
created_at2018-04-23 12:21:47.293135
updated_at2019-03-13 02:05:00.161798
description2 directional hashmaps
homepage
repositoryhttps://github.com/ashfordneil/isomorphism
max_upload_size
id61944
size47,233
Neil Ashford (ashfordneil)

documentation

https://docs.rs/isomorphism/0.1.3

README

isomorphism

2 directional hashmaps in rust

Build Status Crates.io

This crate aims to provide a data structure that can store a 1:1 relation between two different types. This data structure also provides constant time lookup within this relation - in either direction.

use isomorphism::BiMap;

fn main() {
    let mut map = BiMap::new();
    map.insert("Hello", "World");

    assert_eq!(map.get_left("Hello"), Some(&"World"));
    assert_eq!(map.get_right("World"), Some(&"Hello"));
}
Commit count: 59

cargo fmt