pub trait NodeExt: Node {
// Provided methods
fn rewrite<R: NodeRewriter<NodeTy = Self>>(
self,
rewriter: &mut R,
) -> VortexResult<Transformed<Self>> { ... }
fn accept<'a, V: NodeVisitor<'a, NodeTy = Self>>(
&'a self,
visitor: &mut V,
) -> VortexResult<TraversalOrder> { ... }
fn transform_down<F: FnMut(Self) -> VortexResult<Transformed<Self>>>(
self,
f: F,
) -> VortexResult<Transformed<Self>> { ... }
fn transform<F, G>(self, down: F, up: G) -> VortexResult<Transformed<Self>>
where F: FnMut(Self) -> VortexResult<Transformed<Self>>,
G: FnMut(Self) -> VortexResult<Transformed<Self>> { ... }
fn transform_up<F: FnMut(Self) -> VortexResult<Transformed<Self>>>(
self,
f: F,
) -> VortexResult<Transformed<Self>> { ... }
fn fold_context<R, F: NodeFolderContext<NodeTy = Self, Result = R>>(
self,
ctx: &F::Context,
folder: &mut F,
) -> VortexResult<FoldUp<R>> { ... }
fn fold<R, F: NodeFolder<NodeTy = Self, Result = R>>(
self,
folder: &mut F,
) -> VortexResult<FoldUp<R>> { ... }
}Provided Methods§
Sourcefn rewrite<R: NodeRewriter<NodeTy = Self>>(
self,
rewriter: &mut R,
) -> VortexResult<Transformed<Self>>
fn rewrite<R: NodeRewriter<NodeTy = Self>>( self, rewriter: &mut R, ) -> VortexResult<Transformed<Self>>
Walk the tree in pre-order (top-down) way, rewriting it as it goes.
Sourcefn accept<'a, V: NodeVisitor<'a, NodeTy = Self>>(
&'a self,
visitor: &mut V,
) -> VortexResult<TraversalOrder>
fn accept<'a, V: NodeVisitor<'a, NodeTy = Self>>( &'a self, visitor: &mut V, ) -> VortexResult<TraversalOrder>
A pre-order (top-down) traversal.
Sourcefn transform_down<F: FnMut(Self) -> VortexResult<Transformed<Self>>>(
self,
f: F,
) -> VortexResult<Transformed<Self>>
fn transform_down<F: FnMut(Self) -> VortexResult<Transformed<Self>>>( self, f: F, ) -> VortexResult<Transformed<Self>>
A pre-order transformation
fn transform<F, G>(self, down: F, up: G) -> VortexResult<Transformed<Self>>where
F: FnMut(Self) -> VortexResult<Transformed<Self>>,
G: FnMut(Self) -> VortexResult<Transformed<Self>>,
Sourcefn transform_up<F: FnMut(Self) -> VortexResult<Transformed<Self>>>(
self,
f: F,
) -> VortexResult<Transformed<Self>>
fn transform_up<F: FnMut(Self) -> VortexResult<Transformed<Self>>>( self, f: F, ) -> VortexResult<Transformed<Self>>
A post-order transform
Sourcefn fold_context<R, F: NodeFolderContext<NodeTy = Self, Result = R>>(
self,
ctx: &F::Context,
folder: &mut F,
) -> VortexResult<FoldUp<R>>
fn fold_context<R, F: NodeFolderContext<NodeTy = Self, Result = R>>( self, ctx: &F::Context, folder: &mut F, ) -> VortexResult<FoldUp<R>>
applies the NodeFolderContext to the Node tree, with an initial Context.
Sourcefn fold<R, F: NodeFolder<NodeTy = Self, Result = R>>(
self,
folder: &mut F,
) -> VortexResult<FoldUp<R>>
fn fold<R, F: NodeFolder<NodeTy = Self, Result = R>>( self, folder: &mut F, ) -> VortexResult<FoldUp<R>>
applies the NodeFolder to the Node tree
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".