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

pub struct SmallInts<F: Integer + Bounded + NumCast + Copy, B: Integer + NumCast + Copy> {
    // some 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]

fn new() -> Self

Create a new instance.

fn with_capacity(n: usize) -> Self

Create a new instance with a given capacity.

fn from_elem(v: S, n: usize) -> Self

Create a new instance containing n times the integer v (and v is expected to be small).

fn get(&self, i: usize) -> Option<B>

Return the integer at position i.

fn push(&mut self, v: B)

Append v to the sequence. This will determine whether v is big or small and store it accordingly.

fn set(&mut self, i: usize, v: B)

Set value of position i to v. This will determine whether v is big or small and store it accordingly.

fn iter(&self) -> Iter<S, B>

Iterate over sequence. Values will be returned in the big integer type (B).

fn decompress(&self) -> Vec<B>

Decompress into a normal vector of big integers (type B).

fn len(&self) -> usize

Length of the sequence.

fn is_empty(&self) -> bool

is the sequence empty?