Skip to main content

ReverseGraph

Trait ReverseGraph 

Source
pub trait ReverseGraph<const S: usize = DEFAULT_GRAPH_SUCCS_NUM> {
    type G: Graph<S>;

    // Required methods
    fn rev(&self) -> ReversedRefGraph<'_, Self::G, S>;
    fn into_rev(self) -> ReversedIntoGraph<Self::G, S>;
}
Expand description

Graph type that implements this trait can create reversed graph.

Required Associated Types§

Source

type G: Graph<S>

Required Methods§

Source

fn rev(&self) -> ReversedRefGraph<'_, Self::G, S>

Reversed graph.

Source

fn into_rev(self) -> ReversedIntoGraph<Self::G, S>

Reversed graph that consumes the original graph.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const S: usize, T: Graph<S>> ReverseGraph<S> for T

Default ReverseGraph implementation for any type that implements Graph

This can be chained multiple times, e.g., graph.rev().rev() becomes the same as graph. This behavior is the same as std::iter::Iterator::rev().

Source§

type G = T