pub trait Walker<Context> {
type Item;
fn walk_next(&mut self, context: Context) -> Option<Self::Item>;
fn iter(self, context: Context) -> WalkerIter<Self, Context>
where
Context: Clone,
{ ... }
}
Expand description
A walker is a traversal state, but where part of the traversal information is supplied manually to each next call.
This for example allows graph traversals that don’t hold a borrow of the graph they are traversing.
Required Associated Types
Required Methods
Provided Methods
fn iter(self, context: Context) -> WalkerIter<Self, Context> where
Context: Clone,
fn iter(self, context: Context) -> WalkerIter<Self, Context> where
Context: Clone,
Create an iterator out of the walker and given context
.