Struct index_list::IndexList[][src]

pub struct IndexList<T> { /* fields omitted */ }

Implementations

impl<T> IndexList<T>[src]

pub fn new() -> Self[src]

pub fn capacity(&self) -> usize[src]

pub fn len(&self) -> usize[src]

pub fn clear(&mut self)[src]

pub fn is_empty(&self) -> bool[src]

pub fn is_index_used(&self, index: Index) -> bool[src]

pub fn first_index(&self) -> Index[src]

pub fn last_index(&self) -> Index[src]

pub fn next_index(&self, index: Index) -> Index[src]

pub fn prev_index(&self, index: Index) -> Index[src]

pub fn get_first(&self) -> Option<&T>[src]

pub fn get_last(&self) -> Option<&T>[src]

pub fn get(&self, index: Index) -> Option<&T>[src]

pub fn get_mut_first(&mut self) -> Option<&mut T>[src]

pub fn get_mut_last(&mut self) -> Option<&mut T>[src]

pub fn get_mut(&mut self, index: Index) -> Option<&mut T>[src]

pub fn peek_next(&self, index: Index) -> Option<&T>[src]

pub fn peek_prev(&self, index: Index) -> Option<&T>[src]

pub fn contains(&self, elem: T) -> bool where
    T: PartialEq
[src]

pub fn insert_first(&mut self, elem: T) -> Index[src]

pub fn insert_last(&mut self, elem: T) -> Index[src]

pub fn insert_before(&mut self, index: Index, elem: T) -> Index[src]

pub fn insert_after(&mut self, index: Index, elem: T) -> Index[src]

pub fn remove_first(&mut self) -> Option<T>[src]

pub fn remove_last(&mut self) -> Option<T>[src]

pub fn remove(&mut self, index: Index) -> Option<T>[src]

pub fn iter(&self) -> Iter<'_, T>

Notable traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T;
[src]

pub fn to_vec(&self) -> Vec<&T>[src]

pub fn from(vec: &mut Vec<T>) -> IndexList<T>[src]

pub fn trim_safe(&mut self)[src]

Remove some unused indexes at the end by truncating, if any

pub fn trim_swap(&mut self)[src]

Remove all unused elements by moving indexes then truncating Note that this call may invalidate some indexes

pub fn append(&mut self, other: &mut IndexList<T>)[src]

Add the elements of the other list after the elements of this list

pub fn prepend(&mut self, other: &mut IndexList<T>)[src]

Add the element of the other list before the element of this list

pub fn split(&mut self, index: Index) -> IndexList<T>[src]

Split the elements at this index and after to a new list

Trait Implementations

impl<T: Debug> Debug for IndexList<T>[src]

impl<T> Default for IndexList<T>[src]

impl<T> Display for IndexList<T> where
    T: Debug
[src]

impl<T> From<T> for IndexList<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for IndexList<T> where
    T: RefUnwindSafe

impl<T> Send for IndexList<T> where
    T: Send

impl<T> Sync for IndexList<T> where
    T: Sync

impl<T> Unpin for IndexList<T> where
    T: Unpin

impl<T> UnwindSafe for IndexList<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.