Trait iset::IndexType [−][src]
pub trait IndexType: Copy + Display + Sized + Eq { const MAX: Self; fn get(self) -> usize; fn new(element_num: usize) -> Result<Self, &'static str>; fn defined(self) -> bool { ... } }
Expand description
Trait for index types: used in the inner representation of IntervalMap and IntervalSet.
Implemented for u8
, u16
, u32
, u64
and u128
. DefaultIx is an alias for default
index type (u32
). IntervalMap
or IntervalSet
can store up to min(usize::MAX, Ix::MAX - 1)
elements.
Using smaller index type saves memory usage and may reduce running time.