Trait petgraph::visit::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.

Object Safety§

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, 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_impl::stable_graph::EdgeReference<'a, E, Ix>
where Ix: IndexType,

source§

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

source§

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

An edge reference