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§
Required Methods§
Sourcefn prev(&self) -> Option<&Self::Key>
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.
Sourcefn next(&self) -> Option<&Self::Key>
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.
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.