pub trait NodeCollection<T>:
Valid
+ Default
+ Clone{
// Required methods
fn from_nodes(nodes: Vec<Node<T>>) -> Self;
fn get(&self, index: usize) -> &Node<T>;
fn get_mut(&mut self, index: usize) -> &mut Node<T>;
fn get_nodes(&self) -> &[Node<T>];
fn get_nodes_mut(&mut self) -> &mut [Node<T>];
// Provided methods
fn set(&mut self, index: usize, node: Node<T>) -> &mut Self { ... }
fn iter(&self) -> Iter<'_, Node<T>> { ... }
fn iter_mut(&mut self) -> IterMut<'_, Node<T>> { ... }
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn attach(&mut self, incoming: usize, outgoing: usize) -> &mut Self { ... }
fn detach(&mut self, incoming: usize, outgoing: usize) -> &mut Self { ... }
}Required Methods§
fn from_nodes(nodes: Vec<Node<T>>) -> Self
fn get(&self, index: usize) -> &Node<T>
fn get_mut(&mut self, index: usize) -> &mut Node<T>
fn get_nodes(&self) -> &[Node<T>]
fn get_nodes_mut(&mut self) -> &mut [Node<T>]
Provided Methods§
fn set(&mut self, index: usize, node: Node<T>) -> &mut Self
fn iter(&self) -> Iter<'_, Node<T>>
fn iter_mut(&mut self) -> IterMut<'_, Node<T>>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn attach(&mut self, incoming: usize, outgoing: usize) -> &mut Self
fn detach(&mut self, incoming: usize, outgoing: usize) -> &mut Self
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.