Trait dot::GraphWalk [−][src]
pub trait GraphWalk<'a, N: Clone, E: Clone> { fn nodes(&'a self) -> Nodes<'a, N>; fn edges(&'a self) -> Edges<'a, E>; fn source(&'a self, edge: &E) -> N; fn target(&'a self, edge: &E) -> N; }
GraphWalk is an abstraction over a graph = (nodes,edges)
made up of node handles N
and edge handles E
, where each E
can be mapped to its source and target nodes.
The lifetime parameter 'a
is exposed in this trait (rather than
introduced as a generic parameter on each method declaration) so
that a client impl can choose N
and E
that have substructure
that is bound by the self lifetime 'a
.
The nodes
and edges
method each return instantiations of
Cow<[T]>
to leave implementers the freedom to create
entirely new vectors or to pass back slices into internally owned
vectors.
Required methods
fn nodes(&'a self) -> Nodes<'a, N>
[src]
Returns all the nodes in this graph.
fn edges(&'a self) -> Edges<'a, E>
[src]
Returns all of the edges in this graph.
fn source(&'a self, edge: &E) -> N
[src]
The source node for edge
.
fn target(&'a self, edge: &E) -> N
[src]
The target node for edge
.