Trait Element

Source
pub trait Element: Debug {
    type Label: Eq + Copy + Hash + Debug + Label + 'static;

    // Required method
    fn label(&self) -> Self::Label;

    // Provided method
    fn value(&self, _index: &<Self::Label as Label>::Index) -> Option<Value<'_>> { ... }
}
Expand description

An element in a graph. This is either an edge or a vertex.

Required Associated Types§

Source

type Label: Eq + Copy + Hash + Debug + Label + 'static

Information about the Label for this element

Required Methods§

Source

fn label(&self) -> Self::Label

Returns the label of the element.

Provided Methods§

Source

fn value(&self, _index: &<Self::Label as Label>::Index) -> Option<Value<'_>>

Given an index returns the value that is associated with this index.

Implementations on Foreign Types§

Source§

impl Element for f32

Source§

type Label = ()

Source§

fn label(&self) -> Self::Label

Source§

impl Element for f64

Source§

type Label = ()

Source§

fn label(&self) -> Self::Label

Source§

impl Element for u32

Source§

type Label = ()

Source§

fn label(&self) -> Self::Label

Source§

impl Element for u64

Source§

type Label = ()

Source§

fn label(&self) -> Self::Label

Source§

impl Element for ()

Source§

type Label = ()

Source§

fn label(&self) -> Self::Label

Implementors§