Trait charcoal::traversal::Visitor [−][src]
Iterator-like structures which control a traversable tree’s cursor and use it to read information from the tree.
Normal visitors cannot mutate trees without the use of interior mutability. See VisitorMut
for a mutable version of this trait.
Associated Types
type Target: Traversable
[src]
The target type which will be traversed by the visitor.
type Output
[src]
The final value produced by the visitor.
Required methods
fn visit<C>(
&mut self,
traversable: impl Borrow<Self::Target>,
cursor: CursorResult<C>
) -> VisitorDirection<C, Self::Output> where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
[src]
&mut self,
traversable: impl Borrow<Self::Target>,
cursor: CursorResult<C>
) -> VisitorDirection<C, Self::Output> where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
Visit the provided node, returning further directions for traversal.
Panics
Required to panic if called after a Stop
value has already been produced. May also panic for other reasons, as appropriate and specified by the documentation on the trait implementation.
Implementations on Foreign Types
impl<T: Visitor> Visitor for &mut T
[src]
type Target = T::Target
type Output = T::Output
fn visit<C>(
&mut self,
traversable: impl Borrow<Self::Target>,
cursor: CursorResult<C>
) -> VisitorDirection<C, Self::Output> where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
[src]
&mut self,
traversable: impl Borrow<Self::Target>,
cursor: CursorResult<C>
) -> VisitorDirection<C, Self::Output> where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,