Nodes

Trait Nodes 

Source
pub trait Nodes<T, const N: usize, Id> {
    // Required methods
    fn iter_nodes<'a>(&'a self) -> impl Iterator<Item = &'a Node<T, N>>
       where T: 'a;
    fn iter_nodes_mut<'a>(
        &'a mut self,
    ) -> impl Iterator<Item = &'a mut Node<T, N>>
       where T: 'a;
    fn par_iter_nodes_mut<'a>(
        &'a mut self,
    ) -> impl ParallelIterator<Item = &'a mut Node<T, N>>
       where T: 'a + Send,
             Id: Sync;
    fn get_2_mut(
        &mut self,
        i1: Id,
        i2: Id,
    ) -> (&mut Node<T, N>, &mut Node<T, N>);
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Collection of nodes for the layout

Required Methods§

Source

fn iter_nodes<'a>(&'a self) -> impl Iterator<Item = &'a Node<T, N>>
where T: 'a,

Create an iterator through the nodes

Source

fn iter_nodes_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Node<T, N>>
where T: 'a,

Create a mutable iterator through the nodes

Source

fn par_iter_nodes_mut<'a>( &'a mut self, ) -> impl ParallelIterator<Item = &'a mut Node<T, N>>
where T: 'a + Send, Id: Sync,

Create a mutable parallel iterator through the nodes

Source

fn get_2_mut(&mut self, i1: Id, i2: Id) -> (&mut Node<T, N>, &mut Node<T, N>)

Get mutable references to 2 distinct nodes

Source

fn len(&self) -> usize

Get the number of nodes

Provided Methods§

Source

fn is_empty(&self) -> bool

Is length zero?

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<T: Clone, const N: usize> Nodes<T, N, usize> for NodeVec<T, N>

Source§

impl<T: Clone, const N: usize, Id: Eq + Hash> Nodes<T, N, Id> for NodeHashMap<T, N, Id>