Trait charcoal::traversal::VisitorMut [−][src]
A version of Visitor
with an added ability to acquire mutable access to the tree’s nodes.
Mutating visitors require exclusive mutable access to the tree they are visiting. If you only need to read data from the tree instead of mutating it or if the nodes use interior mutability, use Visitor
.
Associated Types
type Target: TraversableMut
[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_mut<C, M>(
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,
[src]
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,
Visit the provided node with a mutable reference, returning further directions for traversal and giving back ownership of the mutable borrow to the traversable.
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: VisitorMut> VisitorMut for &mut T
[src]
type Target = T::Target
type Output = T::Output
fn visit_mut<C, M>(
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,
[src]
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,
Implementors
impl<T: TraversableMut, F: FnMut(T::Branch) -> T::Leaf> VisitorMut for RecursiveRemovalWith<T, F>
[src]
See the struct-level documentation for a list of all panicking conditions.
type Target = T
type Output = NodeValue<T::Branch, T::Leaf>
fn visit_mut<C, M>(
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,
[src]
&mut self,
traversable: M,
cursor: CursorResult<C>
) -> (VisitorDirection<C, Self::Output>, M) where
C: From<<Self::Target as Traversable>::Cursor> + Into<<Self::Target as Traversable>::Cursor> + Clone + Debug + Eq,
M: BorrowMut<Self::Target>,