CursorMut

Struct CursorMut 

Source
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,

Source

pub fn as_cursor(&self) -> Cursor<'_, T, N>

Source

pub fn as_list(&self) -> &ArrayList<T, N>

Source

pub fn back(&self) -> Option<&T>

Source

pub fn back_mut(&mut self) -> Option<&mut T>

Source

pub fn current(&mut self) -> Option<&mut T>

Source

pub fn front(&self) -> Option<&T>

Source

pub fn front_mut(&mut self) -> Option<&mut T>

Source

pub fn index(&self) -> Option<usize>

Source

pub fn insert_after(&mut self, value: T)

Source

pub fn insert_before(&mut self, value: T)

Source

pub fn move_next(&mut self)

Source

pub fn move_prev(&mut self)

Source

pub fn peek_next(&mut self) -> Option<&mut T>

Source

pub fn peek_prev(&mut self) -> Option<&mut T>

Source

pub fn push_front(&mut self, value: T)

Source

pub fn push_back(&mut self, value: T)

Source

pub fn pop_front(&mut self) -> Option<T>

Source

pub fn pop_back(&mut self) -> Option<T>

Source

pub fn remove_current(&mut self) -> Option<T>

Trait Implementations§

Source§

impl<T, const N: usize> Debug for CursorMut<'_, T, N>
where T: Debug, Usize<N>: ChunkCapacity,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.