upair

Crates.ioupair
lib.rsupair
version0.1.1
sourcesrc
created_at2022-04-25 20:58:33.922783
updated_at2022-04-26 15:56:59.948632
descriptionUnordered pair data structure.
homepage
repositoryhttps://github.com/AdrienDML/upair/
max_upload_size
id574087
size5,044
Aleod (Aleod-m)

documentation

README

UPair.

This data structure permits to have unordered pair keys for Hash based storage for example.

Basic requirements.

The inner Type needs to implement the Ord trait.

let storage = HashSet::new();
storage.insert(UPair::new(1, 2));
assert!(storage.contains(UPair::new(2, 1));

Trait implemented.

  • Debug if implemented by inner type.
  • Copy if implemented by inner type.
  • Hash if implemented by inner type.
  • Eq, PartialEq if implemented by inner type.
  • Ord, PartialOrd.
  • From<(T, T)>.
  • From<[T; 2]>.
  • IntoIterator.
Commit count: 5

cargo fmt