Trait GraphStore

Source
pub trait GraphStore: Send {
    type Node: Send;
    type Handle: Clone + Send;

    // Required method
    fn insert(
        &mut self,
        from_handle: Option<Self::Handle>,
        node: GraphNode<Self::Node>,
    ) -> Option<(Self::Handle, &Self::Node)>;
}
Expand description

A graph store is a data structure that will be built up during a graph traversal. It is used to store the results of the traversal.

Required Associated Types§

Required Methods§

Source

fn insert( &mut self, from_handle: Option<Self::Handle>, node: GraphNode<Self::Node>, ) -> Option<(Self::Handle, &Self::Node)>

Inserts a node into the graph store, and returns a handle to it.

If this method returns None, the node edges will not be visited.

Implementors§

Source§

impl<StoreImpl> GraphStore for SkipDuplicates<StoreImpl>
where StoreImpl: GraphStore, StoreImpl::Node: Eq + Hash + Clone,

Source§

type Node = <StoreImpl as GraphStore>::Node

Source§

type Handle = <StoreImpl as GraphStore>::Handle

Source§

impl<T> GraphStore for AdjacencyMap<T>
where T: Eq + Hash + Clone + Send,

Source§

type Node = T

Source§

type Handle = T

Source§

impl<T> GraphStore for NonDeterministic<T>
where T: Send,