Crate utote[−][src]
The Utote crate provides a statically allocated implementation of a multiset of unsigned integers. The implementation utilises type level unsigned integers from the typenum crate, along with the generic-array crate to enable generically sized static multisets.
Examples
use utote::MSu8; use typenum::U4; let multiset = MSu8::<U4>::from_slice(&[1, 3, 5, 7]); assert_eq!(multiset.total(), 16); assert_eq!(multiset.get(1), Some(3));
Optionally the packed_simd crate can be enabled (requires nightly) to allow for multisets which are built either from an array of SIMD vectors, or directly from a single SIMD vector. Although the compiler is very good at auto-vectorising code, these capabilities are provided so that you can explicitly direct the compiler to use SIMD vectors, if they are available.
Examples
use utote::MSu8x2; use typenum::U2; let multiset = MSu8x2::<U2>::from_slice(&[1, 3, 5, 7]); assert_eq!(multiset.total(), 16); assert_eq!(multiset.get(1), Some(3));
Structs
Multiset | Multiset! yay |
MultisetIterator |
Traits
MultisetStorage | Trait enabling the sleight of hand using different typenum structs to define different storage types. |