petgraph::visit

Trait NodeRef

Source
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

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, Id, W> NodeRef for (Id, &'a W)
where Id: Copy,

Source§

type NodeId = Id

Source§

type Weight = W

Source§

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

Source§

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

Source§

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

Source§

type NodeId = Id

Source§

type Weight = ()

Source§

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

Source§

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

Implementors§