[][src]Trait plexus::index::Indexer

pub trait Indexer<T, K> where
    T: Topological
{ fn index<F>(
        &mut self,
        vertex: T::Vertex,
        f: F
    ) -> (usize, Option<T::Vertex>)
    where
        F: Fn(&T::Vertex) -> &K
; }

Vertex indexer.

Disambiguates arbitrary vertex data and emits a one-to-one mapping of indices to vertices.

Required methods

fn index<F>(&mut self, vertex: T::Vertex, f: F) -> (usize, Option<T::Vertex>) where
    F: Fn(&T::Vertex) -> &K, 

Indexes a vertex using a keying function.

Returns a tuple containing the index and optionally vertex data. Vertex data is only returned if the data has not yet been indexed, otherwise None is returned.

Loading content...

Implementors

impl<T, K> Indexer<T, K> for HashIndexer<T, K> where
    T: Topological,
    K: Clone + Eq + Hash
[src]

impl<T, K> Indexer<T, K> for LruIndexer<T, K> where
    T: Topological,
    K: Clone + PartialEq
[src]

Loading content...