Struct Cursor

Source
pub struct Cursor<'a, K, N, M> { /* private fields */ }
Expand description

A cursor over a KeyNodeList.

Implementations§

Source§

impl<'a, K, N, M> Cursor<'a, K, N, M>

Source

pub fn is_null(&self) -> bool

Checks if the cursor is currently pointing to the null pair.

Source

pub fn key(&self) -> Option<&K>

Returns a reference to the key that the cursor is currently pointing to.

Returns None if the cursor is currently pointing to the null pair.

Source

pub fn front_key(&self) -> Option<&K>

Provides a reference to the front key of the cursor’s parent list, or None if the list is empty.

Source

pub fn back_key(&self) -> Option<&K>

Provides a reference to the back key of the cursor’s parent list, or None if the list is empty.

Source§

impl<'a, K, N, M> Cursor<'a, K, N, M>
where K: Hash + Eq, M: Map<K, N>,

Source

pub fn node(&self) -> Option<&N>

Returns a reference to the node that the cursor is currently pointing to.

Returns None if the cursor is currently pointing to the null pair.

Source

pub fn front_node(&self) -> Option<&N>

Provides a reference to the front node of the cursor’s parent list, or None if the list is empty.

Source

pub fn back_node(&self) -> Option<&N>

Provides a reference to the back node of the cursor’s parent list, or None if the list is empty.

Source§

impl<'a, K, N, M> Cursor<'a, K, N, M>
where K: Hash + Eq, N: Node<Key = K>, M: Map<K, N>,

Source

pub fn next_key(&self) -> Option<&K>

Returns a reference to the next key.

If the cursor is pointing to the null pair then this returns the first key of the KeyNodeList. If it is pointing to the last key of the KeyNodeList then this returns None.

Source

pub fn prev_key(&self) -> Option<&K>

Returns a reference to the previous key.

If the cursor is pointing to the null pair then this returns the last key of the KeyNodeList. If it is pointing to the first key of the KeyNodeList then this returns None.

Source

pub fn next_node(&self) -> Option<&N>

Returns a reference to the next node.

If the cursor is pointing to the null pair then this returns the first node of the KeyNodeList. If it is pointing to the last node of the KeyNodeList then this returns None.

Source

pub fn prev_node(&self) -> Option<&N>

Returns a reference to the previous node.

If the cursor is pointing to the null pair then this returns the last node of the KeyNodeList. If it is pointing to the first node of the KeyNodeList then this returns None.

Source§

impl<'a, K, N, M> Cursor<'a, K, N, M>
where K: Hash + Eq + Clone, N: Node<Key = K>, M: Map<K, N>,

Source

pub fn move_next(&mut self)

Moves the cursor to the next key-node pair of the KeyNodeList.

If the cursor is pointing to the null pair then this will move it to the first key-node pair of the KeyNodeList. If it is pointing to the last key-node pair of the KeyNodeList then this will move it to the null pair.

Source

pub fn move_prev(&mut self)

Moves the cursor to the previous key-node pair of the KeyNodeList.

If the cursor is pointing to the null pair then this will move it to the last key-node pair of the KeyNodeList. If it is pointing to the first key-node pair of the KeyNodeList then this will move it to the null pair.

Trait Implementations§

Source§

impl<'a, K: Clone, N: Clone, M: Clone> Clone for Cursor<'a, K, N, M>

Source§

fn clone(&self) -> Cursor<'a, K, N, M>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, K, N, M> Debug for Cursor<'a, K, N, M>
where K: Hash + Eq + Debug, N: Node<Key = K> + Debug, M: Map<K, N>,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, K, N, M> Freeze for Cursor<'a, K, N, M>
where K: Freeze,

§

impl<'a, K, N, M> RefUnwindSafe for Cursor<'a, K, N, M>

§

impl<'a, K, N, M> Send for Cursor<'a, K, N, M>
where K: Send + Sync, M: Sync, N: Sync,

§

impl<'a, K, N, M> Sync for Cursor<'a, K, N, M>
where K: Sync, M: Sync, N: Sync,

§

impl<'a, K, N, M> Unpin for Cursor<'a, K, N, M>
where K: Unpin,

§

impl<'a, K, N, M> UnwindSafe for Cursor<'a, K, N, M>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.