Skip to main content

GraphView

Trait GraphView 

Source
pub trait GraphView {
    type Node: Copy + Eq + Hash;
    type Edge: Copy + Eq + Hash;

    // Required methods
    fn node_count(&self) -> usize;
    fn edge_count(&self) -> usize;
    fn node_indices(&self) -> impl Iterator<Item = Self::Node> + '_;
    fn edge_indices(&self) -> impl Iterator<Item = Self::Edge> + '_;
    fn edge_endpoints(
        &self,
        edge: Self::Edge,
    ) -> Option<EdgeEndpoints<Self::Node>>;
    fn outgoing_edges(
        &self,
        node: Self::Node,
    ) -> impl Iterator<Item = Self::Edge> + '_;
    fn incoming_edges(
        &self,
        node: Self::Node,
    ) -> impl Iterator<Item = Self::Edge> + '_;

    // Provided methods
    fn contains_node(&self, node: Self::Node) -> bool { ... }
    fn contains_edge(&self, edge: Self::Edge) -> bool { ... }
    fn edge_references(
        &self,
    ) -> impl Iterator<Item = (Self::Edge, EdgeEndpoints<Self::Node>)> + '_ { ... }
}

Required Associated Types§

Required Methods§

Source

fn node_count(&self) -> usize

Source

fn edge_count(&self) -> usize

Source

fn node_indices(&self) -> impl Iterator<Item = Self::Node> + '_

Source

fn edge_indices(&self) -> impl Iterator<Item = Self::Edge> + '_

Source

fn edge_endpoints(&self, edge: Self::Edge) -> Option<EdgeEndpoints<Self::Node>>

Source

fn outgoing_edges( &self, node: Self::Node, ) -> impl Iterator<Item = Self::Edge> + '_

Source

fn incoming_edges( &self, node: Self::Node, ) -> impl Iterator<Item = Self::Edge> + '_

Provided Methods§

Source

fn contains_node(&self, node: Self::Node) -> bool

Source

fn contains_edge(&self, edge: Self::Edge) -> bool

Source

fn edge_references( &self, ) -> impl Iterator<Item = (Self::Edge, EdgeEndpoints<Self::Node>)> + '_

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl GraphView for Graph

Source§

impl GraphView for Topology

Source§

impl GraphView for WorkingGraph

Source§

impl<G, Predicate> GraphView for EdgeFiltered<'_, G, Predicate>
where G: GraphView, Predicate: Fn(G::Edge) -> bool,

Source§

type Node = <G as GraphView>::Node

Source§

type Edge = <G as GraphView>::Edge

Source§

impl<G, Predicate> GraphView for NodeFiltered<'_, G, Predicate>
where G: GraphView, Predicate: Fn(G::Node) -> bool,

Source§

type Node = <G as GraphView>::Node

Source§

type Edge = <G as GraphView>::Edge

Source§

impl<G: GraphView> GraphView for Reversed<'_, G>

Source§

type Node = <G as GraphView>::Node

Source§

type Edge = <G as GraphView>::Edge

Source§

impl<NodePayload, EdgePayload> GraphView for AcyclicPayloadGraph<NodePayload, EdgePayload>

Source§

impl<NodePayload, EdgePayload> GraphView for PayloadGraph<NodePayload, EdgePayload>

Source§

impl<NodePayload, EdgePayload> GraphView for StablePayloadGraph<NodePayload, EdgePayload>