Struct index_list::IndexList [−][src]
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]
T: PartialEq,
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>ⓘ[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]
T: Debug,
impl<T> From<T> for IndexList<T>[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for IndexList<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for IndexList<T> where
T: Send,
T: Send,
impl<T> Sync for IndexList<T> where
T: Sync,
T: Sync,
impl<T> Unpin for IndexList<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for IndexList<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[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]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,