Trait Vector

Source
pub trait Vector<T> {
    // Required methods
    fn clear(&mut self);
    fn len(&self) -> usize;
    fn push(&mut self, value: T);
    fn slice(&self) -> &[T];
    fn slice_mut(&mut self) -> &mut [T];
}
Expand description

This trait abstracts away a vector implementation.

It is useful for supporting other vectors as tree’s backing storage, such as SmallVec and Bumpalo’s Vec.

Required Methods§

Source

fn clear(&mut self)

Source

fn len(&self) -> usize

Source

fn push(&mut self, value: T)

Source

fn slice(&self) -> &[T]

Source

fn slice_mut(&mut self) -> &mut [T]

Implementations on Foreign Types§

Source§

impl<T> Vector<T> for Vec<T>

Source§

fn clear(&mut self)

Source§

fn len(&self) -> usize

Source§

fn push(&mut self, value: T)

Source§

fn slice(&self) -> &[T]

Source§

fn slice_mut(&mut self) -> &mut [T]

Implementors§