Container

Trait Container 

Source
pub trait Container<T: Clone + TryFrom<Datum>> {
    // Required methods
    fn get_slices(&self) -> Vec<(usize, &[T])>;
    fn get(&self, ix: usize) -> Option<T>;
    fn insert_overwrite(&mut self, ix: usize, x: T);
    fn push(&mut self, xopt: Option<T>);
    fn present_cloned(&self) -> Vec<T>;
    fn remove(&mut self, ix: usize) -> Option<T>;

    // Provided methods
    fn upsize(&mut self, n: usize) { ... }
    fn push_datum(&mut self, x: Datum) { ... }
    fn insert_datum(&mut self, row_ix: usize, x: Datum) { ... }
}
Expand description

A data container

Required Methods§

Source

fn get_slices(&self) -> Vec<(usize, &[T])>

get the data slices and the start indices

Source

fn get(&self, ix: usize) -> Option<T>

Get the entry at ix if it exists

Source

fn insert_overwrite(&mut self, ix: usize, x: T)

Insert or overwrite an entry at ix

Source

fn push(&mut self, xopt: Option<T>)

Append a new datum to the end of the container

Source

fn present_cloned(&self) -> Vec<T>

Get as cloned vector containing only the present data

Source

fn remove(&mut self, ix: usize) -> Option<T>

Remove and return the entry at ix if it exists. Used to mark a present datum as missing, not to completely remove a record. Does not decrease the length.

Provided Methods§

Source

fn upsize(&mut self, n: usize)

Append n new empty entries to the container

Source

fn push_datum(&mut self, x: Datum)

Source

fn insert_datum(&mut self, row_ix: usize, x: Datum)

Implementors§