[][src]Struct bio::data_structures::smallints::SmallInts

pub struct SmallInts<F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> { /* fields omitted */ }

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]

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]

Auto Trait Implementations

impl<F, B> Send for SmallInts<F, B> where
    B: Send,
    F: Send

impl<F, B> Unpin for SmallInts<F, B> where
    B: Unpin,
    F: Unpin

impl<F, B> Sync for SmallInts<F, B> where
    B: Sync,
    F: Sync

impl<F, B> UnwindSafe for SmallInts<F, B> where
    B: RefUnwindSafe + UnwindSafe,
    F: UnwindSafe

impl<F, B> RefUnwindSafe for SmallInts<F, B> where
    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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]