pub struct CursorMut<'a, T, const N: usize>where
T: 'a,
Usize<N>: ChunkCapacity,{ /* private fields */ }Expand description
A cursor over a ArrayList.
A Cursor is like an iterator, except that it can freely seek back-and-forth.
Cursors always rest between two elements in the list, and index in a logically circular way.
To accommodate this, there is a “ghost” non-element that yields None between the head and tail of the list.
When created, cursors start at the front of the list, or the “ghost” non-element if the list is empty.
Implementations§
Source§impl<'a, T, const N: usize> CursorMut<'a, T, N>where
Usize<N>: ChunkCapacity,
impl<'a, T, const N: usize> CursorMut<'a, T, N>where
Usize<N>: ChunkCapacity,
pub fn as_cursor(&self) -> Cursor<'_, T, N>
pub fn as_list(&self) -> &ArrayList<T, N>
pub fn back(&self) -> Option<&T>
pub fn back_mut(&mut self) -> Option<&mut T>
pub fn current(&mut self) -> Option<&mut T>
pub fn front(&self) -> Option<&T>
pub fn front_mut(&mut self) -> Option<&mut T>
pub fn index(&self) -> Option<usize>
pub fn insert_after(&mut self, value: T)
pub fn insert_before(&mut self, value: T)
pub fn move_next(&mut self)
pub fn move_prev(&mut self)
pub fn peek_next(&mut self) -> Option<&mut T>
pub fn peek_prev(&mut self) -> Option<&mut T>
pub fn push_front(&mut self, value: T)
pub fn push_back(&mut self, value: T)
pub fn pop_front(&mut self) -> Option<T>
pub fn pop_back(&mut self) -> Option<T>
pub fn remove_current(&mut self) -> Option<T>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for CursorMut<'a, T, N>
impl<'a, T, const N: usize> RefUnwindSafe for CursorMut<'a, T, N>where
T: RefUnwindSafe,
impl<'a, T, const N: usize> Send for CursorMut<'a, T, N>where
T: Send,
impl<'a, T, const N: usize> Sync for CursorMut<'a, T, N>where
T: Sync,
impl<'a, T, const N: usize> Unpin for CursorMut<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for CursorMut<'a, T, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more