GraphEdgesNominalInterface

Trait GraphEdgesNominalInterface 

Source
pub trait GraphEdgesNominalInterface: GraphNodesNominalInterface {
    type EdgeHandle: EdgeBasicInterface;

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

    // Provided methods
    fn EdgeId<Id>(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> { ... }
    fn out_edges<'a, 'b, IntoId>(
        &'a self,
        node_id: IntoId,
    ) -> Box<dyn Iterator<Item = (<Self::EdgeHandle as HasId>::Id, &'a Self::EdgeHandle)> + 'b>
       where 'a: 'b,
             IntoId: 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 EdgeHandle: EdgeBasicInterface

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.

Required Methods§

Source

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

Get edge with id.

Source

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

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

Provided Methods§

Source

fn EdgeId<Id>(id: Id) -> <Self::EdgeHandle as HasId>::Id
where Id: Into<<Self::EdgeHandle as HasId>::Id>,

Convert argument into edge id.

Source

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.

Source

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

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

Source§

type EdgeHandle = Edge<EdgeId, NodeId, Kind>

Source§

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

Source§

type EdgeHandle = Edge<EdgeId, NodeId, Kind>