pub enum NodeAction {
Keep,
KeepSkipChildren,
Replace(Vec<Node>),
Remove,
}Expand description
Result of visiting one node. Walker consumes this when iterating the parent’s children Vec.
Variants§
Keep
Walker recurses into this node’s children.
KeepSkipChildren
Node stays in place but its children are not visited.
Replace(Vec<Node>)
Splice these nodes into the parent’s children at the current index.
Replacements are NOT re-visited (prevents infinite loops on
transformers that produce nodes matching their own pattern).
Remove
Drop this node from the parent’s children.
Auto Trait Implementations§
impl Freeze for NodeAction
impl RefUnwindSafe for NodeAction
impl Send for NodeAction
impl Sync for NodeAction
impl Unpin for NodeAction
impl UnsafeUnpin for NodeAction
impl UnwindSafe for NodeAction
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more