Trait Node

Source
pub trait Node {
    type Name: AsRef<str>;

    // Required methods
    fn index(&self) -> usize;
    fn name(&self) -> Self::Name;
}
Expand description

Represents a node in a graph

use graph_theory::GraphEngine;

Required Associated Types§

Source

type Name: AsRef<str>

The type of the node’s index

Required Methods§

Source

fn index(&self) -> usize

The index of the node, all kinds of nodes must have an index

§Examples
use graph_theory::GraphEngine;
Source

fn name(&self) -> Self::Name

The weight of the node, only weighted graph nodes has a weight

§Examples
use graph_theory::GraphEngine;

Implementations on Foreign Types§

Source§

impl Node for usize

Source§

type Name = String

Source§

fn index(&self) -> usize

Source§

fn name(&self) -> <usize as Node>::Name

Implementors§