pub struct Cursor<'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> Cursor<'a, T, N>where
T: 'a,
Usize<N>: ChunkCapacity,
impl<'a, T, const N: usize> Cursor<'a, T, N>where
T: 'a,
Usize<N>: ChunkCapacity,
pub fn as_list(&self) -> &'a ArrayList<T, N>
pub fn back(&self) -> Option<&'a T>
pub fn current(&self) -> Option<&'a T>
pub fn front(&self) -> Option<&'a T>
pub fn index(&self) -> Option<usize>
pub fn move_next(&mut self)
pub fn move_prev(&mut self)
pub fn peek_next(&self) -> Option<&'a T>
pub fn peek_prev(&self) -> Option<&'a T>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for Cursor<'a, T, N>
impl<'a, T, const N: usize> RefUnwindSafe for Cursor<'a, T, N>where
T: RefUnwindSafe,
impl<'a, T, const N: usize> Send for Cursor<'a, T, N>where
T: Sync,
impl<'a, T, const N: usize> Sync for Cursor<'a, T, N>where
T: Sync,
impl<'a, T, const N: usize> Unpin for Cursor<'a, T, N>
impl<'a, T, const N: usize> UnwindSafe for Cursor<'a, T, N>where
T: RefUnwindSafe,
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