pub trait Walker<'graph>where
Self: Sized,{
type Graph: Graph;
type Context: Clone + 'static;
// Required methods
fn next_element(
&mut self,
graph: &'graph Self::Graph,
) -> Option<ElementId<Self::Graph>>;
fn ctx(&self) -> &Self::Context;
fn ctx_mut(&mut self) -> &mut Self::Context;
}
Expand description
A trait that defines the basic behavior of a graph walker.
The Walker
trait is the foundation for traversing and exploring graphs in the
graph-api-lib crate. It defines the core methods that all walkers must implement,
such as next_element
to retrieve the next vertex or edge in the graph, and
ctx
to access the walker’s internal context.
Implementors of this trait are responsible for defining the specific graph
representation they work with (via the Graph
associated type) and the
internal state they need to track during the walk (via the Context
associated type).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.