Struct graphs_tools::canonical::factory::orphan::NodeFactory
source · [−]pub struct NodeFactory<NodeId = IdentityWithInt, EdgeId = IdentityWithInt, Kind = NodeKindless> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
NodeFactory<NodeId, EdgeId, Kind>: NodeFactoryInterface, {
pub id_to_node_map: IndexMap<NodeId, Node<NodeId, EdgeId, Kind>>,
pub id_to_edge_map: IndexMap<EdgeId, Edge<EdgeId, NodeId, Kind>>,
pub _current_edge_id: EdgeId,
}
Expand description
Node factory.
Fields
id_to_node_map: IndexMap<NodeId, Node<NodeId, EdgeId, Kind>>
Map id to node.
id_to_edge_map: IndexMap<EdgeId, Edge<EdgeId, NodeId, Kind>>
Map id to edge.
_current_edge_id: EdgeId
Generator of edge ids.
Trait Implementations
sourceimpl<NodeId, EdgeId, Kind> Debug for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> Debug for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesEnumerableInterface for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: IdentityInterface + IdentityGenerableInterface,
NodeId: IdentityInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesEnumerableInterface for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: IdentityInterface + IdentityGenerableInterface,
NodeId: IdentityInterface,
Kind: NodeKindInterface,
sourcefn edges<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &Self::EdgeHandle)> + 'b> where
'a: 'b,
fn edges<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &Self::EdgeHandle)> + 'b> where
'a: 'b,
Iterate over all edges.
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesExtendableInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesExtendableInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn _edge_id_generate(
&mut self,
_in_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
_out_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id
fn _edge_id_generate(
&mut self,
_in_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
_out_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id
Either make new or get existing edge for specified nodes.
sourcefn _edge_add(
&mut self,
edge_id: <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id,
in_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
out_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id
)
fn _edge_add(
&mut self,
edge_id: <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id,
in_node: <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id,
out_node: <<Self 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 as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
IntoNodeId1: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoNodeId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn _edge_make_for_nodes<IntoNodeId1, IntoNodeId2>(
&mut self,
node1: IntoNodeId1,
node2: IntoNodeId2
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
IntoNodeId1: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoNodeId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Either make new or get existing edge for specified nodes.
sourceimpl<NodeId, EdgeId, Kind> GraphEdgesNominalInterface for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: IdentityInterface + IdentityGenerableInterface,
NodeId: IdentityInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphEdgesNominalInterface for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: IdentityInterface + IdentityGenerableInterface,
NodeId: IdentityInterface,
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) -> &Self::EdgeHandle where
IntoId: Into<<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
fn edge<IntoId>(&self, id: IntoId) -> &Self::EdgeHandle where
IntoId: Into<<<Self 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 = <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
fn out_edges_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
Iterate over output edges of the node. Callback gets ids of nodes in neighbourhood of a picked node.
sourcefn EdgeId<Id>(
id: Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
Id: Into<<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
fn EdgeId<Id>(
id: Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
Id: Into<<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
Convert argument into edge id.
sourcefn edge_id<Id>(
&self,
id: Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
Id: Into<<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id>,
fn edge_id<Id>(
&self,
id: Id
) -> <<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id where
Id: Into<<<Self as GraphEdgesNominalInterface>::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 as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &<Self as GraphEdgesNominalInterface>::EdgeHandle)> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
fn out_edges<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = (<<Self as GraphEdgesNominalInterface>::EdgeHandle as HasId>::Id, &<Self as GraphEdgesNominalInterface>::EdgeHandle)> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
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 NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesEnumerableInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
sourcefn nodes<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &<Self as GraphNodesNominalInterface>::NodeHandle)> + 'b> where
'a: 'b,
fn nodes<'a, 'b>(
&'a self
) -> Box<dyn Iterator<Item = (<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &<Self as GraphNodesNominalInterface>::NodeHandle)> + 'b> where
'a: 'b,
Iterate over all nodes.
sourceimpl<NodeId, EdgeId, Kind> GraphNodesExtendableInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesExtendableInterface for NodeFactory<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<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iter: IntoIterator<Item = IntoId2>,
Iter::IntoIter: Clone,
fn node_add_out_nodes<IntoId1, IntoId2, Iter>(
&mut self,
in_node_id: IntoId1,
out_nodes_iter: Iter
) where
IntoId1: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Iter: IntoIterator<Item = IntoId2>,
Iter::IntoIter: Clone,
Iterate output nodes of the node.
sourcefn node_mut<IntoId>(&mut self, id: IntoId) -> &mut Self::NodeHandle where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node_mut<IntoId>(&mut self, id: IntoId) -> &mut Self::NodeHandle where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Get node with id mutably.
sourcefn node_making<IntoId>(
&mut self,
id: IntoId
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node_making<IntoId>(
&mut self,
id: IntoId
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
IntoId: Into<<<Self 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 as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId1: Clone,
IntoId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Clone,
fn node_add_out_node<IntoId1, IntoId2>(
&mut self,
node_id: IntoId1,
out_node_id: IntoId2
) where
IntoId1: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId1: Clone,
IntoId2: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoId2: Clone,
Add out edges to the node.
sourcefn make_with_edge_list<IntoIter, Id>(&mut self, into_iter: IntoIter) where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoIter: IntoIterator<Item = Id>,
IntoIter::IntoIter: ExactSizeIterator<Item = Id>,
fn make_with_edge_list<IntoIter, Id>(&mut self, into_iter: IntoIter) where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
IntoIter: IntoIterator<Item = Id>,
IntoIter::IntoIter: ExactSizeIterator<Item = Id>,
Make edges.
sourceimpl<NodeId, EdgeId, Kind> GraphNodesNominalInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> GraphNodesNominalInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
type NodeHandle = Node<NodeId, EdgeId, Kind>
type NodeHandle = 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) -> &Self::NodeHandle where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node<IntoId>(&self, id: IntoId) -> &Self::NodeHandle where
IntoId: Into<<<Self 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 = <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
fn out_nodes_ids<'a, 'b, IntoId>(
&'a self,
node_id: IntoId
) -> Box<dyn Iterator<Item = <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id> + 'b> where
IntoId: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
Iterate over neighbourhood of the node. Callback gets ids of nodes in neighbourhood of a picked node.
sourcefn NodeId<Id>(
id: Id
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn NodeId<Id>(
id: Id
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
Convert argument into node id.
sourcefn node_id<Id>(
&self,
id: Id
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
fn node_id<Id>(
&self,
id: Id
) -> <<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id where
Id: Into<<<Self as GraphNodesNominalInterface>::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 as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &<Self as GraphNodesNominalInterface>::NodeHandle)> + 'b> where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
fn out_nodes<'a, 'b, Id>(
&'a self,
node_id: Id
) -> Box<dyn Iterator<Item = (<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id, &<Self as GraphNodesNominalInterface>::NodeHandle)> + 'b> where
Id: Into<<<Self as GraphNodesNominalInterface>::NodeHandle as HasId>::Id>,
'a: 'b,
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 NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> Make0 for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
impl<NodeId, EdgeId, Kind> NodeFactoryInterface for NodeFactory<NodeId, EdgeId, Kind> where
NodeId: IdentityInterface,
EdgeId: IdentityInterface + IdentityGenerableInterface,
Kind: NodeKindInterface,
Auto Trait Implementations
impl<NodeId, EdgeId, Kind> RefUnwindSafe for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: RefUnwindSafe,
Kind: RefUnwindSafe,
NodeId: RefUnwindSafe,
impl<NodeId, EdgeId, Kind> Send for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: Send,
Kind: Send,
NodeId: Send,
impl<NodeId, EdgeId, Kind> Sync for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: Sync,
Kind: Sync,
NodeId: Sync,
impl<NodeId, EdgeId, Kind> Unpin for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: Unpin,
Kind: Unpin,
NodeId: Unpin,
impl<NodeId, EdgeId, Kind> UnwindSafe for NodeFactory<NodeId, EdgeId, Kind> where
EdgeId: UnwindSafe,
Kind: UnwindSafe,
NodeId: UnwindSafe,
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.