[−][src]Struct bio::data_structures::smallints::SmallInts
Data structure for storing a sequence of small integers with few big ones space efficiently while supporting classical vector operations.
Methods
impl<S: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> SmallInts<S, B>
[src]
pub fn new() -> Self
[src]
Create a new instance.
pub fn with_capacity(n: usize) -> Self
[src]
Create a new instance with a given capacity.
pub fn from_elem(v: S, n: usize) -> Self
[src]
Create a new instance containing n
times the integer v
(and v
is expected to be small).
pub fn get(&self, i: usize) -> Option<B>
[src]
Return the integer at position i
.
pub fn push(&mut self, v: B)
[src]
Append v
to the sequence. This will determine whether v
is big or small and store it accordingly.
pub fn set(&mut self, i: usize, v: B)
[src]
Set value of position i
to v
. This will determine whether v
is big or small and store it accordingly.
ⓘImportant traits for Iter<'a, S, B>pub fn iter(&self) -> Iter<S, B>
[src]
Iterate over sequence. Values will be returned in the big integer type (B
).
pub fn decompress(&self) -> Vec<B>
[src]
Decompress into a normal vector of big integers (type B
).
pub fn len(&self) -> usize
[src]
Length of the sequence.
pub fn is_empty(&self) -> bool
[src]
is the sequence empty?
Trait Implementations
impl<S: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> Default for SmallInts<S, B>
[src]
impl<F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> Serialize for SmallInts<F, B> where
F: Serialize,
B: Serialize,
[src]
F: Serialize,
B: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> Deserialize<'de> for SmallInts<F, B> where
F: Deserialize<'de>,
B: Deserialize<'de>,
[src]
F: Deserialize<'de>,
B: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<F, B> Send for SmallInts<F, B> where
B: Send,
F: Send,
B: Send,
F: Send,
impl<F, B> Unpin for SmallInts<F, B> where
B: Unpin,
F: Unpin,
B: Unpin,
F: Unpin,
impl<F, B> Sync for SmallInts<F, B> where
B: Sync,
F: Sync,
B: Sync,
F: Sync,
impl<F, B> UnwindSafe for SmallInts<F, B> where
B: RefUnwindSafe + UnwindSafe,
F: UnwindSafe,
B: RefUnwindSafe + UnwindSafe,
F: UnwindSafe,
impl<F, B> RefUnwindSafe for SmallInts<F, B> where
B: RefUnwindSafe,
F: RefUnwindSafe,
B: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,