pub trait NodeRef: Copy {
    type NodeId;
    type Weight;

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

A node reference.

Required Associated Types§

Required Methods§

source

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

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, Id, W> NodeRef for (Id, &'a W)
where Id: Copy,

§

type NodeId = Id

§

type Weight = W

source§

fn id(&self) -> <(Id, &'a W) as NodeRef>::NodeId

source§

fn weight(&self) -> &<(Id, &'a W) as NodeRef>::Weight

source§

impl<Id> NodeRef for (Id, ())
where Id: Copy,

§

type NodeId = Id

§

type Weight = ()

source§

fn id(&self) -> <(Id, ()) as NodeRef>::NodeId

source§

fn weight(&self) -> &<(Id, ()) as NodeRef>::Weight

Implementors§

source§

impl<Ix> NodeRef for Ix
where Ix: IndexType,

§

type NodeId = Ix

§

type Weight = ()