Expand description
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:
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 UOrds created with different initial element orders will be equal to one another.
Modules§
- proxy
- Structs and traits through which you can customize the implementations
of
OrdandPartialEqused for types inUOrd.
Structs§
- UOrd
- An unordered tuple of items of type
Tand lengthN. - UOrd
Into Iter - An iterator over each element of a
UOrd. - UOrd
Iter - An iterator over references to each element of a
UOrd. - UOrd
Proxied Into Iter - An iterator over each element of a
UOrdProxied, stripped of their wrappers. - UOrd
Proxied Iter - An iterator over references to each element of a
UOrdProxied, stripped of their wrappers.
Type Aliases§
- UOrd2
- An unordered tuple of items of type
Tand length 2. - UOrd3
- An unordered tuple of items of type
Tand length 3. - UOrd4
- An unordered tuple of items of type
Tand length 4. - UOrd5
- An unordered tuple of items of type
Tand length 5. - UOrd6
- An unordered tuple of items of type
Tand length 6. - UOrd
Proxied - An unordered tuple of items of type
Tand lengthN, additionally utilizing aProxy. - UOrd
Proxied2 - An unordered tuple of items of type
Tand length 2, additionally utilizing aProxy. - UOrd
Proxied3 - An unordered tuple of items of type
Tand length 3, additionally utilizing aProxy. - UOrd
Proxied4 - An unordered tuple of items of type
Tand length 4, additionally utilizing aProxy. - UOrd
Proxied5 - An unordered tuple of items of type
Tand length 5, additionally utilizing aProxy. - UOrd
Proxied6 - An unordered tuple of items of type
Tand length 6, additionally utilizing aProxy.