logo
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
; }
Expand description

Vertex indexer.

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

Required Methods

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.

Implementors