Trait GraphNodesNominalInterface

Source
pub trait GraphNodesNominalInterface {
    type NodeHandle: NodeBasicInterface;

    // Required methods
    fn node<Id>(&self, id: Id) -> &Self::NodeHandle
       where Id: Into<<Self::NodeHandle as HasId>::Id>;
    fn out_nodes_ids<'a, 'b, Id>(
        &'a self,
        node_id: Id,
    ) -> Box<dyn Iterator<Item = <Self::NodeHandle as HasId>::Id> + 'b>
       where 'a: 'b,
             Id: Into<<Self::NodeHandle as HasId>::Id>;

    // Provided methods
    fn NodeId<Id>(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> { ... }
    fn out_nodes<'a, 'b, Id>(
        &'a self,
        node_id: Id,
    ) -> Box<dyn Iterator<Item = (<Self::NodeHandle as HasId>::Id, &'a Self::NodeHandle)> + 'b>
       where 'a: 'b,
             Id: Into<<Self::NodeHandle as HasId>::Id> { ... }
}
Expand description

Graph which know how to iterate neighbourhood of a node and capable to convert id of a node into a node.

Required Associated Types§

Source

type NodeHandle: NodeBasicInterface

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.

Required Methods§

Source

fn node<Id>(&self, id: Id) -> &Self::NodeHandle
where Id: Into<<Self::NodeHandle as HasId>::Id>,

Get node with id.

Source

fn out_nodes_ids<'a, 'b, Id>( &'a self, node_id: Id, ) -> Box<dyn Iterator<Item = <Self::NodeHandle as HasId>::Id> + 'b>
where 'a: 'b, Id: Into<<Self::NodeHandle as HasId>::Id>,

Iterate over neighbourhood of the node. Callback gets ids of nodes in neighbourhood of a picked node.

Provided Methods§

Source

fn NodeId<Id>(id: Id) -> <Self::NodeHandle as HasId>::Id
where Id: Into<<Self::NodeHandle as HasId>::Id>,

Convert argument into node id.

Source

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.

Source

fn out_nodes<'a, 'b, Id>( &'a self, node_id: Id, ) -> Box<dyn Iterator<Item = (<Self::NodeHandle as HasId>::Id, &'a Self::NodeHandle)> + 'b>
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.

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<NodeId, EdgeId, Kind> GraphNodesNominalInterface for CellNodeFactory<NodeId, EdgeId, Kind>

Source§

type NodeHandle = NodeCell<Node<NodeId, EdgeId, Kind>>

Source§

impl<NodeId, EdgeId, Kind> GraphNodesNominalInterface for NodeFactory<NodeId, EdgeId, Kind>

Source§

type NodeHandle = Node<NodeId, EdgeId, Kind>