Struct linked_vector::Cursor

source ·
pub struct Cursor<'a, T> { /* private fields */ }
Expand description

A cursor which can only read the elements of the list.

Trait Implementations§

source§

impl<'a, T> CursorBase<T> for Cursor<'a, T>

source§

fn get(&self) -> Option<&T>

Returns a reference to the element at the cursor’s current position.
source§

fn get_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the element at the cursor’s current position.
source§

fn move_to(&mut self, handle: HNode) -> bool

Moves the cursor to the specified handle. Returns true if the cursor was moved, false if the handle was invalid.
source§

fn move_next(&mut self) -> Option<HNode>

Moves the cursor to the next element. Returns the handle of the next element if the cursor was moved, None if the cursor was already at the end of the list.
source§

fn move_prev(&mut self) -> Option<HNode>

Moves the cursor to the previous element. Returns the handle of the previous element if the cursor was moved, None if the cursor was already at the start of the list.
source§

fn move_to_start(&mut self) -> Option<HNode>

Moves the cursor to the start of the list. Returns the handle of the first element if the cursor was moved, None if the list is empty.
source§

fn move_to_end(&mut self) -> Option<HNode>

Moves the cursor to the end of the list. Returns the handle of the last element if the cursor was moved, None if the list is empty.
source§

fn forward(&mut self, n: usize) -> Result<HNode, HNode>

Moves the cursor forward by the specified number of elements. Returns the handle of the element at the new position if the cursor was moved, Err(handle) if the cursor was already at the end of the list.
source§

fn backward(&mut self, n: usize) -> Result<HNode, HNode>

Moves the cursor backward by the specified number of elements. Returns the handle of the element at the new position if the cursor was moved, Err(handle) if the cursor was already at the start of the list.

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for Cursor<'a, T>where
T: RefUnwindSafe,

§

impl<'a, T> Send for Cursor<'a, T>where
T: Sync,

§

impl<'a, T> Sync for Cursor<'a, T>where
T: Sync,

§

impl<'a, T> Unpin for Cursor<'a, T>

§

impl<'a, T> UnwindSafe for Cursor<'a, T>where
T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,

§

fn vzip(self) -> V