Type Alias NodeHashMap

Source
pub type NodeHashMap<T, const N: usize, Id> = HashMap<Id, Node<T, N>>;
Expand description

Collection of nodes for the layout, stored in a HashMap

Aliased Type§

pub struct NodeHashMap<T, const N: usize, Id> { /* private fields */ }

Trait Implementations§

Source§

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

Source§

fn add_node(&mut self, id: Id, node: Node<T, N>)

Add a node the the collection
Source§

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

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
Source§

fn is_empty(&self) -> bool

Is length zero?