Struct wautomata::canonical::CellNodeFactory
source · [−]pub struct CellNodeFactory<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
CellNodeFactory<NodeId, EdgeId, Kind>: NodeFactoryInterface, {
pub id_to_node_map: IndexMap<NodeId, NodeCell<Node<NodeId, EdgeId, Kind>>, RandomState>,
pub id_to_edge_map: IndexMap<EdgeId, Edge<EdgeId, NodeId, Kind>, RandomState>,
pub _current_edge_id: EdgeId,
}
Expand description
Node factory.
Fields
id_to_node_map: IndexMap<NodeId, NodeCell<Node<NodeId, EdgeId, Kind>>, RandomState>
Map id to node.
id_to_edge_map: IndexMap<EdgeId, Edge<EdgeId, NodeId, Kind>, RandomState>
Map id to edge.
_current_edge_id: EdgeId
Generator of edge ids.
Trait Implementations
sourceimpl<NodeId, EdgeId, Kind> Debug for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> Debug for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesEnumerableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesEnumerableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn edges<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &'a <CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle)> + 'b, Global> where
'a: 'b,
fn edges<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &'a <CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle)> + 'b, Global> where
'a: 'b,
Iterate over all edges.
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesExtendableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesExtendableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn _edge_id_generate(
&mut self,
_in_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
_out_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
) -> <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id
fn _edge_id_generate(
&mut self,
_in_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
_out_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
) -> <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id
Either make new or get existing edge for specified nodes.
sourcefn _edge_add(
&mut self,
edge_id: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id,
in_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
out_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
)
fn _edge_add(
&mut self,
edge_id: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id,
in_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
out_node: <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
)
Either make new or get existing edge for specified nodes.
sourcefn _edge_make_for_nodes<IntoNodeId1, IntoNodeId2>(
&mut self,
node1: IntoNodeId1,
node2: IntoNodeId2
) -> <Self::EdgeHandle as HasId>::Id where
IntoNodeId1: Into<<Self::NodeHandle as HasId>::Id>,
IntoNodeId2: Into<<Self::NodeHandle as HasId>::Id>,
fn _edge_make_for_nodes<IntoNodeId1, IntoNodeId2>(
&mut self,
node1: IntoNodeId1,
node2: IntoNodeId2
) -> <Self::EdgeHandle as HasId>::Id where
IntoNodeId1: Into<<Self::NodeHandle as HasId>::Id>,
IntoNodeId2: Into<<Self::NodeHandle as HasId>::Id>,
Either make new or get existing edge for specified nodes.
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesNominalInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesNominalInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
type EdgeHandle = Edge<EdgeId, NodeId, Kind>
type EdgeHandle = Edge<EdgeId, NodeId, Kind>
Handle of an edge - entity representing an edge or the edge itself. It’s not always possible to operate an edge directly, for example it it has to be wrapped by cell ref. For that use NodeHandle. Otherwise EdgeHandle could be &Node. Read more
sourcefn edge<IntoId>(
&self,
id: IntoId
) -> &<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
fn edge<IntoId>(
&self,
id: IntoId
) -> &<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
Get edge with id.
sourcefn out_edges_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id> + 'b, Global> where
'a: 'b,
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn out_edges_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id> + 'b, Global> where
'a: 'b,
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iterate over output edges of the node. Callback gets ids of nodes in neighbourhood of a picked node.
sourcefn EdgeId<Id>(id: Id) -> <Self::EdgeHandle as HasId>::Id where
Id: Into<<Self::EdgeHandle as HasId>::Id>,
fn EdgeId<Id>(id: Id) -> <Self::EdgeHandle as HasId>::Id where
Id: Into<<Self::EdgeHandle as HasId>::Id>,
Convert argument into edge id.
sourcefn edge_id<Id>(&self, id: Id) -> <Self::EdgeHandle as HasId>::Id where
Id: Into<<Self::EdgeHandle as HasId>::Id>,
fn edge_id<Id>(&self, id: Id) -> <Self::EdgeHandle as HasId>::Id where
Id: Into<<Self::EdgeHandle as HasId>::Id>,
Convert argument into edge id.
sourcefn out_edges<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = (<Self::EdgeHandle as HasId>::Id, &'a Self::EdgeHandle)> + 'b, Global> where
'a: 'b,
IntoId: Into<<Self::NodeHandle as HasId>::Id>,
fn out_edges<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = (<Self::EdgeHandle as HasId>::Id, &'a Self::EdgeHandle)> + 'b, Global> where
'a: 'b,
IntoId: Into<<Self::NodeHandle as HasId>::Id>,
Iterate over output edges of the node. Callback gets ids and references of edges in neighbourhood of a picked node.
sourceimpl<NodeId, EdgeId, Kind> GraphNodesEnumerableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesEnumerableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn nodes<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &'a <CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle)> + 'b, Global> where
'a: 'b,
fn nodes<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &'a <CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle)> + 'b, Global> where
'a: 'b,
Iterate over all nodes.
sourceimpl<NodeId, EdgeId, Kind> GraphNodesExtendableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesExtendableInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn node_add_out_nodes<IntoId1, IntoId2, Iter>(
&mut self,
in_node_id: IntoId1,
out_nodes_iter: Iter
) where
IntoId1: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iter: IntoIterator<Item = IntoId2>,
<Iter as IntoIterator>::IntoIter: Clone,
fn node_add_out_nodes<IntoId1, IntoId2, Iter>(
&mut self,
in_node_id: IntoId1,
out_nodes_iter: Iter
) where
IntoId1: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iter: IntoIterator<Item = IntoId2>,
<Iter as IntoIterator>::IntoIter: Clone,
Iterate output nodes of the node.
sourcefn node_mut<IntoId>(
&mut self,
id: IntoId
) -> &mut <CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node_mut<IntoId>(
&mut self,
id: IntoId
) -> &mut <CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Get node with id mutably.
sourcefn node_making<IntoId>(
&mut self,
id: IntoId
) -> <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node_making<IntoId>(
&mut self,
id: IntoId
) -> <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Either make new or get existing node.
sourcefn node_add_out_node<IntoId1, IntoId2>(
&mut self,
node_id: IntoId1,
out_node_id: IntoId2
) where
IntoId1: Into<<Self::NodeHandle as HasId>::Id> + Clone,
IntoId2: Into<<Self::NodeHandle as HasId>::Id> + Clone,
fn node_add_out_node<IntoId1, IntoId2>(
&mut self,
node_id: IntoId1,
out_node_id: IntoId2
) where
IntoId1: Into<<Self::NodeHandle as HasId>::Id> + Clone,
IntoId2: Into<<Self::NodeHandle as HasId>::Id> + Clone,
Add out edges to the node.
sourcefn make_with_edge_list<IntoIter, Id>(&mut self, into_iter: IntoIter) where
Id: Into<<Self::NodeHandle as HasId>::Id>,
IntoIter: IntoIterator<Item = Id>,
<IntoIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<IntoIter as IntoIterator>::IntoIter as Iterator>::Item == Id,
fn make_with_edge_list<IntoIter, Id>(&mut self, into_iter: IntoIter) where
Id: Into<<Self::NodeHandle as HasId>::Id>,
IntoIter: IntoIterator<Item = Id>,
<IntoIter as IntoIterator>::IntoIter: ExactSizeIterator,
<<IntoIter as IntoIterator>::IntoIter as Iterator>::Item == Id,
Make edges.
sourceimpl<NodeId, EdgeId, Kind> GraphNodesNominalInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesNominalInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
type NodeHandle = NodeCell<Node<NodeId, EdgeId, Kind>>
type NodeHandle = NodeCell<Node<NodeId, EdgeId, Kind>>
Handle of a node - entity representing a node or the node itself. It’s not always possible to operate a node directly, for example it it has to be wrapped by cell ref. For that use NodeHandle. Otherwise NodeHandle could be &Node. Read more
sourcefn node<IntoId>(
&self,
id: IntoId
) -> &<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node<IntoId>(
&self,
id: IntoId
) -> &<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle where
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Get node with id.
sourcefn out_nodes_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id> + 'b, Global> where
'a: 'b,
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn out_nodes_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id> + 'b, Global> where
'a: 'b,
IntoId: Into<<<CellNodeFactory<NodeId, EdgeId, Kind> as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iterate over neighbourhood of the node. Callback gets ids of nodes in neighbourhood of a picked node.
sourcefn NodeId<Id>(id: Id) -> <Self::NodeHandle as HasId>::Id where
Id: Into<<Self::NodeHandle as HasId>::Id>,
fn NodeId<Id>(id: Id) -> <Self::NodeHandle as HasId>::Id where
Id: Into<<Self::NodeHandle as HasId>::Id>,
Convert argument into node id.
sourcefn node_id<Id>(&self, id: Id) -> <Self::NodeHandle as HasId>::Id where
Id: Into<<Self::NodeHandle as HasId>::Id>,
fn node_id<Id>(&self, id: Id) -> <Self::NodeHandle as HasId>::Id where
Id: Into<<Self::NodeHandle as HasId>::Id>,
Convert argument into node id.
sourcefn out_nodes<'a, 'b, Id>(
&'a self,
node_id: Id
) -> Box<dyn Iterator<Item = (<Self::NodeHandle as HasId>::Id, &'a Self::NodeHandle)> + 'b, Global> where
'a: 'b,
Id: Into<<Self::NodeHandle as HasId>::Id>,
fn out_nodes<'a, 'b, Id>(
&'a self,
node_id: Id
) -> Box<dyn Iterator<Item = (<Self::NodeHandle as HasId>::Id, &'a Self::NodeHandle)> + 'b, Global> where
'a: 'b,
Id: Into<<Self::NodeHandle as HasId>::Id>,
Iterate over neighbourhood of the node. Callback gets ids and reference on itself of nodes in neighbourhood of a picked node.
sourceimpl<NodeId, EdgeId, Kind> Make0 for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> Make0 for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn make_0() -> CellNodeFactory<NodeId, EdgeId, Kind>
fn make_0() -> CellNodeFactory<NodeId, EdgeId, Kind>
Constructor without arguments.
impl<NodeId, EdgeId, Kind> NodeFactoryInterface for CellNodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
Auto Trait Implementations
impl<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> !RefUnwindSafe for CellNodeFactory<NodeId, EdgeId, Kind>
impl<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> !Send for CellNodeFactory<NodeId, EdgeId, Kind>
impl<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> !Sync for CellNodeFactory<NodeId, EdgeId, Kind>
impl<NodeId, EdgeId, Kind> Unpin for CellNodeFactory<NodeId, EdgeId, Kind> where
EdgeId: Unpin,
Kind: Unpin,
NodeId: Unpin,
impl<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> !UnwindSafe for CellNodeFactory<NodeId, EdgeId, Kind>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
sourceimpl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
sourcefn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.