pub struct NodeCollection<T: Debug + Clone> {
pub nodes: Vec<Node<T>>,
}
Expand description
NodeCollection
represents a Vec
of Node
s. Usually retrived by collecting over
a Node
linked list using the CollectNode
trait implementation.
WARNING: this is not a linked list, but simply a collection of unrelated nodes.
The contained nodes might come from separated linked lists or from the same one.
Fields§
§nodes: Vec<Node<T>>
Implementations§
Source§impl<T: Debug + Clone> NodeCollection<T>
impl<T: Debug + Clone> NodeCollection<T>
pub fn new() -> Self
Sourcepub fn into_nodes(self) -> Vec<Node<T>>
pub fn into_nodes(self) -> Vec<Node<T>>
Consume self
and retrive its Node
s.
Sourcepub fn as_mut_nodes(&mut self) -> &mut Vec<Node<T>>
pub fn as_mut_nodes(&mut self) -> &mut Vec<Node<T>>
Retrive a mutable reference to the Node
s.
Sourcepub fn free(&self)
pub fn free(&self)
Re-set the parent
, prev
and next
pointers in every node of the collection.
This function is commonly used when iterating over a linked list detaching the
nodes satisfying an identifier using HedelDetach::detach_preserve
.
refer to HedelDetach::detach_preserve
for a code example.
WARNING: don’t use this function to detach a node from a linked list.
Trait Implementations§
Source§impl<T: Debug + Clone> IntoIterator for NodeCollection<T>
impl<T: Debug + Clone> IntoIterator for NodeCollection<T>
Auto Trait Implementations§
impl<T> Freeze for NodeCollection<T>
impl<T> !RefUnwindSafe for NodeCollection<T>
impl<T> !Send for NodeCollection<T>
impl<T> !Sync for NodeCollection<T>
impl<T> Unpin for NodeCollection<T>
impl<T> !UnwindSafe for NodeCollection<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more