GraphStore

Trait GraphStore 

Source
pub trait GraphStore: Send {
    type Node: Send;
    type Edge: Send;
    type Handle: Send;

    // Required methods
    fn insert(
        &mut self,
        from: Option<(&Self::Handle, Self::Edge)>,
        node: Self::Node,
    );
    fn try_enter(&mut self, node: &Self::Node) -> Option<Self::Handle>;
}
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: Option<(&Self::Handle, Self::Edge)>, node: 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.

Source

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

Tries to enter a node during traversal for visiting its edges. Returns true if the node edges should be visited. Returns false if the node has already been visited and should not be explored again.

Implementors§

Source§

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

Source§

type Node = T

Source§

type Edge = E

Source§

type Handle = T

Source§

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