Skip to main content

VertexMap

Trait VertexMap 

Source
pub trait VertexMap<T>: Graph {
    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, vertex: Self::Vertex) -> &'a T;
    fn vmap_get_mut<'a>(
        &self,
        map: &'a mut Self::Vmap,
        vertex: Self::Vertex,
    ) -> &'a mut T;

    // Provided method
    fn vmap_set(&self, map: &mut Self::Vmap, vertex: Self::Vertex, value: 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, vertex: Self::Vertex) -> &'a T

Source

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

Provided Methods§

Source

fn vmap_set(&self, map: &mut Self::Vmap, vertex: Self::Vertex, value: T)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A, T> VertexMap<T> for GridGraph<A>
where Self: Graph<Vertex = (usize, usize)>,

Source§

type Vmap = 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>
where Self: Graph<Vertex = usize>,

Source§

type Vmap = Vec<T>

Source§

impl<T> VertexMap<T> for AdjacencyListGraph

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, Self: Graph<Vertex = V>,

Source§

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