Trait DirectedRef

Source
pub trait DirectedRef<'a>: UndirectedRef<'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: DirectedEdge<Edge = Self::Edge> + Copy + Eq;

    // Required methods
    fn out_iter(&self, u: Self::Node) -> Self::OutIt;
    fn in_iter(&self, u: Self::Node) -> Self::InIt;
    fn incident_iter(&self, u: Self::Node) -> Self::IncidentIt;

    // Provided methods
    fn outedges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::OutIt> 
       where Self: Sized { ... }
    fn inedges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::InIt> 
       where Self: Sized { ... }
    fn incident_edges(
        &self,
        u: Self::Node,
    ) -> GraphIter<'_, Self, Self::IncidentIt> 
       where Self: Sized { ... }
}
Expand description

A reference to a digraph.

This trait contains methods with a unrestricted lifetime for self.

Required Associated Types§

Source

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

Type of a graph iterator over edges leaving a node.

Source

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

Type of a graph iterator over edges entering a node.

Source

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

Type of an iterator over all incident edges.

Source

type DirectedEdge: DirectedEdge<Edge = Self::Edge> + Copy + Eq

Type of a directed edge.

Required Methods§

Source

fn out_iter(&self, u: Self::Node) -> Self::OutIt

Return the source node of an edge. Return the sink node of an edge. Return a graph iterator over the edges leaving a node.

Source

fn in_iter(&self, u: Self::Node) -> Self::InIt

Return a graph iterator over the edges leaving a node.

Source

fn incident_iter(&self, u: Self::Node) -> Self::IncidentIt

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

Provided Methods§

Source

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

Return an iterator over the edges leaving a node.

Source

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

Return an iterator over the edges leaving a node.

Source

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

Return an iterator over all directed edges incident with a 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.

Implementations on Foreign Types§

Source§

impl<'a, G> DirectedRef<'a> for &'a G
where G: Directed,

Source§

type OutIt = WrapIt<<G as Directed>::OutIt<'a>>

Source§

type InIt = WrapIt<<G as Directed>::InIt<'a>>

Source§

type IncidentIt = WrapIt<<G as Directed>::IncidentIt<'a>>

Source§

type DirectedEdge = <G as Directed>::DirectedEdge<'a>

Source§

fn out_iter(&self, u: Self::Node) -> Self::OutIt

Source§

fn in_iter(&self, u: Self::Node) -> Self::InIt

Source§

fn incident_iter(&self, u: Self::Node) -> Self::IncidentIt

Source§

impl<'a, G> DirectedRef<'a> for NonNull<G>
where G: Directed + 'a,

Source§

type OutIt = WrapIt<<G as Directed>::OutIt<'a>>

Source§

type InIt = WrapIt<<G as Directed>::InIt<'a>>

Source§

type IncidentIt = WrapIt<<G as Directed>::IncidentIt<'a>>

Source§

type DirectedEdge = <G as Directed>::DirectedEdge<'a>

Source§

fn out_iter(&self, u: Self::Node) -> Self::OutIt

Source§

fn in_iter(&self, u: Self::Node) -> Self::InIt

Source§

fn incident_iter(&self, u: Self::Node) -> Self::IncidentIt

Implementors§

Source§

impl<'a, G> DirectedRef<'a> for Network<'a, G>
where G: 'a + Directed,

Source§

impl<'a, G> DirectedRef<'a> for ReverseDigraph<'a, G>
where G: DirectedRef<'a>,

Source§

type OutIt = ReverseWrapIt<<G as DirectedRef<'a>>::InIt>

Source§

type InIt = ReverseWrapIt<<G as DirectedRef<'a>>::OutIt>

Source§

type IncidentIt = ReverseIncidentIt<<G as DirectedRef<'a>>::IncidentIt>

Source§

type DirectedEdge = ReverseDirectedEdge<<G as DirectedRef<'a>>::DirectedEdge>