Trait zerovec::map::ZeroVecLike[][src]

pub trait ZeroVecLike<'a, T> {
    type NeedleType: ?Sized;
    type GetType: ?Sized;
Show methods fn binary_search(&self, k: &Self::NeedleType) -> Result<usize, usize>;
fn get(&self, index: usize) -> Option<&Self::GetType>;
fn insert(&mut self, index: usize, value: T);
fn remove(&mut self, index: usize) -> T;
fn replace(&mut self, index: usize, value: T) -> T;
fn push(&mut self, value: T);
fn len(&self) -> usize;
fn new() -> Self;
fn with_capacity(cap: usize) -> Self;
fn clear(&mut self);
fn reserve(&mut self, addl: usize);
fn is_ascending(&self) -> bool; fn is_empty(&self) -> bool { ... }
}
Expand description

Trait abstracting over ZeroVec and VarZeroVec, for use in ZeroMap. You should not be implementing or calling this trait directly.

Associated Types

The type received by Self::binary_search()

The type returned by Self::get()

Required methods

Search for a key in a sorted vector, returns Ok(index) if found, returns Err(insert_index) if not found, where insert_index is the index where it should be inserted to maintain sort order.

Get element at index

Insert an element at index

Remove the element at index (panicking if nonexistant)

Replace the element at index with another one, returning the old element

Push an element to the end of this vector

The length of this vector

Create a new, empty vector

Create a new, empty vector, with given capacity

Remove all elements from the vector

Reserve space for addl additional elements

Check if this vector is in ascending order according to Ts Ord impl

Provided methods

Check if this vector is empty

Implementors