Trait memtable_core::list::List[][src]

pub trait List: Sized {
    type Item;
    fn new_filled_with<F: FnMut(usize) -> Option<Self::Item>>(
        n: usize,
        f: F
    ) -> Self;
fn max_capacity(&self) -> Capacity;
fn len(&self) -> usize;
fn get(&self, index: usize) -> Option<&Self::Item>;
fn get_mut(&mut self, index: usize) -> Option<&mut Self::Item>;
fn insert(&mut self, index: usize, element: Self::Item);
fn remove(&mut self, index: usize) -> Self::Item; fn is_empty(&self) -> bool { ... } }
Expand description

Represents a generic list of items

Associated Types

Represents the type of item within the list

Required methods

Creates a new list with up to N elements, each created using the provided function; when the provided function returns None, the underlying list implementation will determine what to do

Returns the maximum capacity of the list

Returns the actual length of the list, which may be less than the actual capacity

Returns a reference to an element found at the given index, or None if no element found

Returns a mutable reference to an element found at the given index, or None if no element found

Inserts an element at position index within the vector, shifting all elements after it to the right

Panics

Panics if index > len

Removes and returns the element at position index within the vector, shifting all elements after it to the left.

Panics

Panics if index is out of bounds

Provided methods

Returns true if the list is empty

Implementors