pub struct SmallInts<F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> { /* private fields */ }
Expand description
Data structure for storing a sequence of small integers with few big ones space efficiently while supporting classical vector operations.
Implementations
Create a new instance with a given capacity.
Create a new instance containing n
times the integer v
(and v
is expected to be small).
Append v
to the sequence. This will determine whether v
is big or small and store it accordingly.
Set value of position i
to v
. This will determine whether v
is big or small and store it accordingly.
Iterate over sequence. Values will be returned in the big integer type (B
).
Decompress into a normal vector of big integers (type B
).
Trait Implementations
impl<'de, F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> Deserialize<'de> for SmallInts<F, B> where
F: Deserialize<'de>,
B: Deserialize<'de>,
impl<'de, F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> Deserialize<'de> for SmallInts<F, B> where
F: Deserialize<'de>,
B: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<F, B> RefUnwindSafe for SmallInts<F, B> where
B: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, B> UnwindSafe for SmallInts<F, B> where
B: RefUnwindSafe,
F: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.