Trait rs_graph::traits::Directed[][src]

pub trait Directed<'a>: Undirected<'a> {
    type OutIt: GraphIterator<Self, Item = (Self::Edge, Self::Node)>;
    type InIt: GraphIterator<Self, Item = (Self::Edge, Self::Node)>;
    type IncidentIt: GraphIterator<Self, Item = (Self::DirectedEdge, Self::Node)>;
    type DirectedEdge: 'a + DirectedEdge<Edge = Self::Edge> + Copy + Eq;
    fn src(&'a self, e: Self::Edge) -> Self::Node;
fn snk(&'a self, e: Self::Edge) -> Self::Node;
fn out_iter(&'a self, u: Self::Node) -> Self::OutIt;
fn in_iter(&'a self, u: Self::Node) -> Self::InIt;
fn incident_iter(&'a self, u: Self::Node) -> Self::IncidentIt; fn outedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::OutIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;

    where
        Self: Sized
, { ... }
fn outgoing(&'a self) -> OutEdges<'a, Self>
    where
        Self: Sized
, { ... }
fn inedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::InIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;

    where
        Self: Sized
, { ... }
fn incoming(&'a self) -> InEdges<'a, Self>
    where
        Self: Sized
, { ... }
fn incident_edges(
        &'a self,
        u: Self::Node
    ) -> GraphIter<'a, Self, Self::IncidentIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;

    where
        Self: Sized
, { ... } }

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 and snk methods return the source and sink nodes of an edge.
  • The iterators outedges and inedges iterate only over edges leaving or entering a certain node, respectively.

Associated Types

type OutIt: GraphIterator<Self, Item = (Self::Edge, Self::Node)>[src]

Type of a graph iterator over edges leaving a node.

type InIt: GraphIterator<Self, Item = (Self::Edge, Self::Node)>[src]

Type of a graph iterator over edges entering a node.

type IncidentIt: GraphIterator<Self, Item = (Self::DirectedEdge, Self::Node)>[src]

Type of an iterator over all incident edges.

type DirectedEdge: 'a + DirectedEdge<Edge = Self::Edge> + Copy + Eq[src]

Type of a directed edge.

Loading content...

Required methods

fn src(&'a self, e: Self::Edge) -> Self::Node[src]

Return the source node of an edge.

fn snk(&'a self, e: Self::Edge) -> Self::Node[src]

Return the sink node of an edge.

fn out_iter(&'a self, u: Self::Node) -> Self::OutIt[src]

Return a graph iterator over the edges leaving a node.

fn in_iter(&'a self, u: Self::Node) -> Self::InIt[src]

Return a graph iterator over the edges leaving a node.

fn incident_iter(&'a self, u: Self::Node) -> Self::IncidentIt[src]

Return an iterator over all directed edges incident with a node.

Loading content...

Provided methods

fn outedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::OutIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over the edges leaving a node.

fn outgoing(&'a self) -> OutEdges<'a, Self> where
    Self: Sized
[src]

Return access to the outgoing arcs via an Adjacencies trait.

This is the same as calling OutEdges(&g) on the graph.

fn inedges(&'a self, u: Self::Node) -> GraphIter<'a, Self, Self::InIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over the edges leaving a node.

fn incoming(&'a self) -> InEdges<'a, Self> where
    Self: Sized
[src]

Return access to the incoming arcs via an Adjacencies trait.

This is the same as calling InEdges(&g) on the graph.

fn incident_edges(
    &'a self,
    u: Self::Node
) -> GraphIter<'a, Self, Self::IncidentIt>

Notable traits for GraphIter<'a, G, I>

impl<'a, G, I> Iterator for GraphIter<'a, G, I> where
    I: GraphIterator<G>, 
type Item = I::Item;
where
    Self: Sized
[src]

Return an iterator over all directed edges incident with a node.

Loading content...

Implementations on Foreign Types

impl<'a, 'g: 'a, G> Directed<'a> for &'g G where
    G: Directed<'g>, 
[src]

type OutIt = WrapIt<G::OutIt>

type InIt = WrapIt<G::InIt>

type IncidentIt = WrapIt<G::IncidentIt>

type DirectedEdge = G::DirectedEdge

Loading content...

Implementors

impl<'a, 'g: 'a, G> Directed<'a> for Network<'g, G> where
    G: Digraph<'g>, 
[src]

type OutIt = NetworkOutIt<G::IncidentIt>

type InIt = NetworkInIt<G::IncidentIt>

type IncidentIt = NetworkIncidentIt<G::IncidentIt, (G::DirectedEdge, G::Node)>

type DirectedEdge = NetworkDirectedEdge<Self::Edge>

impl<'a, G> Directed<'a> for ReverseDigraph<'a, G> where
    G: Directed<'a>, 
[src]

type OutIt = ReverseWrapIt<G::InIt>

type InIt = ReverseWrapIt<G::OutIt>

type IncidentIt = ReverseIncidentIt<G::IncidentIt>

type DirectedEdge = ReverseDirectedEdge<G::DirectedEdge>

impl<'a, G, Gx, Nx, Ex> Directed<'a> for Attributed<G, Gx, Nx, Ex> where
    G: Directed<'a>,
    Gx: 'a + Default,
    Nx: 'a + Default,
    Ex: 'a + Default
[src]

type OutIt = AttributedWrapIt<G::OutIt>

type InIt = AttributedWrapIt<G::InIt>

type IncidentIt = AttributedWrapIt<G::IncidentIt>

type DirectedEdge = G::DirectedEdge

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]

type OutIt = Filtered<G::OutIt>

type InIt = Filtered<G::InIt>

type IncidentIt = FilteredIncidentIt<G::IncidentIt>

type DirectedEdge = G::DirectedEdge

impl<'a, ID> Directed<'a> for VecGraph<ID> where
    ID: 'a + PrimInt + Unsigned
[src]

type OutIt = NeighIt<'a, ID>

type InIt = NeighIt<'a, ID>

type IncidentIt = NeighIt<'a, ID>

type DirectedEdge = Self::Edge

impl<'a, ID, N: 'a, E: 'a> Directed<'a> for LinkedListGraph<ID, N, E> where
    ID: 'a + PrimInt + Unsigned
[src]

type OutIt = OutIt<ID>

type InIt = InIt<ID>

type IncidentIt = IncidentIt<ID>

type DirectedEdge = Self::Edge

Loading content...