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,

§

type NodeId = N

§

type EdgeId = (N, N)

§

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>

§

type NodeId = Ix

§

type EdgeId = EdgeIndex<Ix>

§

type Weight = E

source§

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

§

type NodeId = Ix

§

type EdgeId = usize

§

type Weight = E

source§

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

§

type NodeId = NodeIndex<Ix>

§

type EdgeId = EdgeIndex<Ix>

§

type Weight = E

source§

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

An edge reference

§

type NodeId = <R as EdgeRef>::NodeId

§

type EdgeId = <R as EdgeRef>::EdgeId

§

type Weight = <R as EdgeRef>::Weight