Skip to main content

NodeExt

Trait NodeExt 

Source
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 fold_context<R, F: NodeFolderContext<NodeTy = Self, Result = R>>(
        self,
        ctx: &F::Context,
        folder: &mut F,
    ) -> VortexResult<FoldUp<R>> { ... }
}

Provided Methods§

Source

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.

Source

fn accept<'a, V: NodeVisitor<'a, NodeTy = Self>>( &'a self, visitor: &mut V, ) -> VortexResult<TraversalOrder>

A pre-order (top-down) traversal.

Source

fn transform_down<F: FnMut(Self) -> VortexResult<Transformed<Self>>>( self, f: F, ) -> VortexResult<Transformed<Self>>

A pre-order transformation

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Node> NodeExt for T