Skip to content

ashfordneil/isomorphism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"));
}

About

2 directional hashmaps in rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages