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 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§

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 transform<F, G>(self, down: F, up: G) -> VortexResult<Transformed<Self>>
where F: FnMut(Self) -> VortexResult<Transformed<Self>>, G: FnMut(Self) -> VortexResult<Transformed<Self>>,

Source

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

A post-order transform

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.

Source

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".

Implementors§

Source§

impl<T: Node> NodeExt for T