uord 0.1.0

An implementation of unordered pairs (or more generally, unordered sets)
Documentation
  • Coverage
  • 100%
    115 out of 115 items documented1 out of 98 items with examples
  • Size
  • Source code size: 57.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 11.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 25s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ScottyThePilot/uord
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ScottyThePilot

UOrd

Crate Documentation

A library providing implementations of unordered pairs (or more generally, unordered sets).

This is useful when, for example, you want to create a HashMap that associates data with pairs of things:

use uord::UOrd2;
use std::collections::HashMap;
let mut map: HashMap<UOrd2<u16>, String> = HashMap::new();
map.insert(UOrd2::new([1, 6]), "1-6".to_owned());
map.insert(UOrd2::new([3, 5]), "3-5".to_owned());
map.insert(UOrd2::new([2, 4]), "2-4".to_owned());

assert!(map.contains_key(&UOrd2::new([1, 6])));

When creating a [UOrd], the ordering of the items on creation does not matter, and [UOrd]s created with different initial element orders will be equal to one another.