petgraph::visit

Trait EdgeRef

Source
pub trait EdgeRef: Copy {
    type NodeId;
    type EdgeId;
    type Weight;

    // Required methods
    fn source(&self) -> Self::NodeId;
    fn target(&self) -> Self::NodeId;
    fn weight(&self) -> &Self::Weight;
    fn id(&self) -> Self::EdgeId;
}
Expand description

An edge reference.

Edge references are used by traits IntoEdges and IntoEdgeReferences.

Required Associated Types§

Required Methods§

Source

fn source(&self) -> Self::NodeId

The source node of the edge.

Source

fn target(&self) -> Self::NodeId

The target node of the edge.

Source

fn weight(&self) -> &Self::Weight

A reference to the weight of the edge.

Source

fn id(&self) -> Self::EdgeId

The edge’s identifier.

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, N, E> EdgeRef for (N, N, &'a E)
where N: Copy,

Source§

type NodeId = N

Source§

type EdgeId = (N, N)

Source§

type Weight = E

Source§

fn source(&self) -> N

Source§

fn target(&self) -> N

Source§

fn weight(&self) -> &E

Source§

fn id(&self) -> (N, N)

Implementors§

Source§

impl<'a, E, Ix: IndexType> EdgeRef for petgraph::adj::EdgeReference<'a, E, Ix>

Source§

impl<'a, E, Ty, Ix> EdgeRef for petgraph::csr::EdgeReference<'a, E, Ty, Ix>
where Ty: EdgeType, Ix: IndexType,

Source§

impl<'a, Ix, E> EdgeRef for petgraph::graph::EdgeReference<'a, E, Ix>
where Ix: IndexType,

Source§

impl<'a, Ix, E> EdgeRef for petgraph::stable_graph::EdgeReference<'a, E, Ix>
where Ix: IndexType,

Source§

impl<R> EdgeRef for ReversedEdgeReference<R>
where R: EdgeRef,

An edge reference