Trait IsDataContainer

Source
pub trait IsDataContainer<T> {
    // Required methods
    fn reserve_d(&mut self, n: usize);
    fn len_d(&self) -> usize;
    fn push_d(&mut self, x: T);
    fn get_d(&self, index: usize) -> T;
    fn set_d(&mut self, index: usize, x: T);
}
Expand description

IsDataContainer trait used for data containers allowing for different storage types than using the abstracted type

Required Methods§

Source

fn reserve_d(&mut self, n: usize)

Should reserve space for n elements of type T

Source

fn len_d(&self) -> usize

Should return the number of T elements in the container

Source

fn push_d(&mut self, x: T)

Should push a T to the end of the container

Source

fn get_d(&self, index: usize) -> T

Should return the element at index

Source

fn set_d(&mut self, index: usize, x: T)

Should set the element at index

Implementors§