Trait Node

Source
pub trait Node {
    type Key;

    // Required methods
    fn prev(&self) -> Option<&Self::Key>;
    fn next(&self) -> Option<&Self::Key>;
    fn prev_mut<T: NodeToken>(&mut self) -> &mut Option<Self::Key>;
    fn next_mut<T: NodeToken>(&mut self) -> &mut Option<Self::Key>;
}
Expand description

Trait for nodes that holds its previous and next key in KeyNodeList.

Required Associated Types§

Source

type Key

Key type of the current Node.

Required Methods§

Source

fn prev(&self) -> Option<&Self::Key>

Returns a reference to the previous key of the current node, or returns None if the current node is the first node in the list.

Source

fn next(&self) -> Option<&Self::Key>

Returns a reference to the next key of the current node, or returns None if the current node is the last node in the list.

Source

fn prev_mut<T: NodeToken>(&mut self) -> &mut Option<Self::Key>

Returns a mutable reference to the previous key of the current node so that KeyNodeList can update the order of the nodes.

Source

fn next_mut<T: NodeToken>(&mut self) -> &mut Option<Self::Key>

Returns a mutable reference to the next key of the current node so that KeyNodeList can update the order of the nodes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<K, V> Node for ValueNode<K, V>

Source§

type Key = K