pub enum TraversalEvent {
Discover(NodeId),
TreeEdge {
source: NodeId,
target: NodeId,
edge: EdgeId,
},
NonTreeEdge {
source: NodeId,
target: NodeId,
edge: EdgeId,
},
BackEdge {
source: NodeId,
target: NodeId,
edge: EdgeId,
},
Finish(NodeId),
}Expand description
Events emitted during graph traversal (BFS/DFS).
These events follow the visitor pattern, allowing algorithms to react to different stages of the traversal.
Variants§
Discover(NodeId)
A node is discovered for the first time.
TreeEdge
A tree edge is traversed (edge to an undiscovered node).
Fields
NonTreeEdge
A non-tree edge is traversed (edge to an already-discovered node). In BFS, this is a cross edge. In DFS, this could be a back edge or cross edge.
Fields
BackEdge
A back edge is traversed (DFS only - edge to an ancestor).
Fields
Finish(NodeId)
Processing of a node is complete.
Implementations§
Trait Implementations§
Source§impl Clone for TraversalEvent
impl Clone for TraversalEvent
Source§fn clone(&self) -> TraversalEvent
fn clone(&self) -> TraversalEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TraversalEvent
impl Debug for TraversalEvent
Source§impl PartialEq for TraversalEvent
impl PartialEq for TraversalEvent
impl Copy for TraversalEvent
impl Eq for TraversalEvent
impl StructuralPartialEq for TraversalEvent
Auto Trait Implementations§
impl Freeze for TraversalEvent
impl RefUnwindSafe for TraversalEvent
impl Send for TraversalEvent
impl Sync for TraversalEvent
impl Unpin for TraversalEvent
impl UnwindSafe for TraversalEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.