Trait VertexMap

Source
pub trait VertexMap<T>: GraphBase {
    type Vmap;

    // Required methods
    fn construct_vmap<F>(&self, f: F) -> Self::Vmap
       where F: FnMut() -> T;
    fn vmap_get<'a>(&self, map: &'a Self::Vmap, vid: Self::VIndex) -> &'a T;
    fn vmap_get_mut<'a>(
        &self,
        map: &'a mut Self::Vmap,
        vid: Self::VIndex,
    ) -> &'a mut T;

    // Provided method
    fn vmap_set(&self, map: &mut Self::Vmap, vid: Self::VIndex, x: T) { ... }
}

Required Associated Types§

Required Methods§

Source

fn construct_vmap<F>(&self, f: F) -> Self::Vmap
where F: FnMut() -> T,

Source

fn vmap_get<'a>(&self, map: &'a Self::Vmap, vid: Self::VIndex) -> &'a T

Source

fn vmap_get_mut<'a>( &self, map: &'a mut Self::Vmap, vid: Self::VIndex, ) -> &'a mut T

Provided Methods§

Source

fn vmap_set(&self, map: &mut Self::Vmap, vid: Self::VIndex, x: T)

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.

Implementors§

Source§

impl<A, T> VertexMap<T> for GridGraph<A>

Source§

type Vmap = Vec<Vec<T>>

Source§

impl<D, T> VertexMap<T> for SparseGraph<D>

Source§

type Vmap = Vec<T>

Source§

impl<Fa, T> VertexMap<T> for UsizeGraph<Fa>

Source§

type Vmap = Vec<T>

Source§

impl<V, Fv, Fa, T> VertexMap<T> for ClosureGraph<V, Fv, Fa>
where V: Eq + Copy + Hash, T: Clone,

Source§

type Vmap = (HashMap<V, T>, T)