[−][src]Trait rs_graph::traits::Directed
A graph with list access to directed incident edges.
Note that each directed graph is also an undirected graph
by simply ignoring the direction of each edge. Hence, each
type implementing Directed
must also implement Undirected
.
This trait adds a few additional methods to explicitely access the direction information of an edge. In particular, the direction information can be used in the following ways:
- The
src
andsnk
methods return the source and sink nodes of an edge. - The iterators
outedges
andinedges
iterate only over edges leaving or entering a certain node, respectively.
Associated Types
type OutEdge: 'a + Clone
Type of a graph iterator over edges leaving a node.
type InEdge: 'a + Clone
Type of a graph iterator over edges entering a node.
type IncidentEdge: 'a + Clone
Type of an iterator over all incident edges.
type DirectedEdge: 'a + DirectedEdge<Edge = Self::Edge> + Copy + Eq
Type of a directed edge.
Required methods
fn src(&'a self, e: Self::Edge) -> Self::Node
Return the source node of an edge.
fn snk(&'a self, e: Self::Edge) -> Self::Node
Return the sink node of an edge.
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
Return an iterator over the edges leaving a node.
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
Advance the iterator to the next outgoing edge.
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
Return the edge and sink node of an outgoing edge iterator.
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
Return an iterator over the edges entering a node.
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
Advance the iterator to the next incoming edge.
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
Return the edge and sink node of an incoming edge iterator.
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
Return an iterator over the edges entering a node.
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
Advance the iterator to the next incoming edge.
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
Return the edge and sink node of an incoming edge iterator.
Provided methods
ⓘImportant traits for OutEdgeIter<'a, G>fn outedges(&'a self, u: Self::Node) -> OutEdgeIter<'a, Self> where
Self: Sized,
Self: Sized,
Return an iterator over the outgoing edges of a node.
fn outgoing(&'a self) -> OutEdges<'a, Self> where
Self: Sized,
Self: Sized,
Return access to the outgoing arcs via an Adjacencies
trait.
This is the same as calling OutEdges(&g)
on the graph.
ⓘImportant traits for InEdgeIter<'a, G>fn inedges(&'a self, u: Self::Node) -> InEdgeIter<'a, Self> where
Self: Sized,
Self: Sized,
Return an iterator over the incoming edges of a node.
fn incoming(&'a self) -> InEdges<'a, Self> where
Self: Sized,
Self: Sized,
Return access to the incoming arcs via an Adjacencies
trait.
This is the same as calling InEdges(&g)
on the graph.
ⓘImportant traits for IncidentEdgeIter<'a, G>fn incident_edges(&'a self, u: Self::Node) -> IncidentEdgeIter<'a, Self> where
Self: Sized,
Self: Sized,
Return access to all incident edges of a node.
Implementations on Foreign Types
impl<'a, 'g: 'a, G> Directed<'a> for &'g G where
G: Directed<'g>,
[src]
G: Directed<'g>,
type OutEdge = G::OutEdge
type InEdge = G::InEdge
type IncidentEdge = G::IncidentEdge
type DirectedEdge = G::DirectedEdge
fn src(&'a self, e: Self::Edge) -> Self::Node
[src]
fn snk(&'a self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
Implementors
impl<'a, G> Directed<'a> for Network<G> where
G: Digraph<'a>,
[src]
G: Digraph<'a>,
type OutEdge = NetworkOutEdge<G::IncidentEdge>
type InEdge = NetworkInEdge<G::IncidentEdge>
type IncidentEdge = NetworkIncidentEdge<G::IncidentEdge>
type DirectedEdge = NetworkDirectedEdge<Self::Edge>
fn src(&'a self, e: Self::Edge) -> Self::Node
[src]
fn snk(&'a self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
impl<'a, G> Directed<'a> for ReverseDigraph<G> where
G: Directed<'a>,
[src]
G: Directed<'a>,
type OutEdge = G::InEdge
type InEdge = G::OutEdge
type IncidentEdge = G::IncidentEdge
type DirectedEdge = ReverseDirectedEdge<G::DirectedEdge>
fn src(&'a self, e: Self::Edge) -> Self::Node
[src]
fn snk(&'a self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
impl<'a, G, Gx, Nx, Ex> Directed<'a> for Attributed<G, Gx, Nx, Ex> where
G: Directed<'a>,
Gx: Default,
Nx: Default,
Ex: Default,
[src]
G: Directed<'a>,
Gx: Default,
Nx: Default,
Ex: Default,
type OutEdge = G::OutEdge
type InEdge = G::InEdge
type IncidentEdge = G::IncidentEdge
type DirectedEdge = G::DirectedEdge
fn src(&'a self, e: Self::Edge) -> Self::Node
[src]
fn snk(&'a self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
impl<'a, G, P> Directed<'a> for FilteredGraph<'a, G, P> where
G: Directed<'a>,
P: 'a + for<'r> Fn(&'r G::Edge) -> bool,
[src]
G: Directed<'a>,
P: 'a + for<'r> Fn(&'r G::Edge) -> bool,
type OutEdge = Filtered<G::OutEdge>
type InEdge = Filtered<G::InEdge>
type IncidentEdge = Filtered<G::IncidentEdge>
type DirectedEdge = G::DirectedEdge
fn src(&'a self, e: Self::Edge) -> Self::Node
[src]
fn snk(&'a self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
impl<'a, ID, N: 'a, E: 'a> Directed<'a> for LinkedListGraph<ID, N, E> where
ID: 'a + PrimInt + Unsigned,
[src]
ID: 'a + PrimInt + Unsigned,
type OutEdge = OutEdge<ID>
type InEdge = InEdge<ID>
type IncidentEdge = IncidentEdge<ID>
type DirectedEdge = Self::Edge
fn src(&self, e: Self::Edge) -> Self::Node
[src]
fn snk(&self, e: Self::Edge) -> Self::Node
[src]
fn first_out(&'a self, u: Self::Node) -> Option<Self::OutEdge>
[src]
fn next_out(&'a self, it: Self::OutEdge) -> Option<Self::OutEdge>
[src]
fn get_out(&'a self, it: &Self::OutEdge) -> (Self::Edge, Self::Node)
[src]
fn first_in(&'a self, u: Self::Node) -> Option<Self::InEdge>
[src]
fn next_in(&'a self, it: Self::InEdge) -> Option<Self::InEdge>
[src]
fn get_in(&'a self, it: &Self::InEdge) -> (Self::Edge, Self::Node)
[src]
fn first_incident(&'a self, u: Self::Node) -> Option<Self::IncidentEdge>
[src]
fn next_incident(&'a self, it: Self::IncidentEdge) -> Option<Self::IncidentEdge>
[src]
fn get_incident(
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)
[src]
&'a self,
it: &Self::IncidentEdge
) -> (Self::DirectedEdge, Self::Node)