Node

Trait Node 

Source
pub trait Node: Sized + Clone {
    // Required methods
    fn apply_children<'a, F: FnMut(&'a Self) -> VortexResult<TraversalOrder>>(
        &'a self,
        f: F,
    ) -> VortexResult<TraversalOrder>;
    fn map_children<F: FnMut(Self) -> VortexResult<Transformed<Self>>>(
        self,
        f: F,
    ) -> VortexResult<Transformed<Self>>;
    fn iter_children<T>(
        &self,
        f: impl FnOnce(&mut dyn Iterator<Item = &Self>) -> T,
    ) -> T;
    fn children_count(&self) -> usize;
}

Required Methods§

Source

fn apply_children<'a, F: FnMut(&'a Self) -> VortexResult<TraversalOrder>>( &'a self, f: F, ) -> VortexResult<TraversalOrder>

Walk the node’s children by applying f to them.

This is a lower level API that other functions rely on for their implementation.

Source

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

Rewrite the node’s children by applying f to them.

This is a lower level API that other functions rely on for their implementation.

Source

fn iter_children<T>( &self, f: impl FnOnce(&mut dyn Iterator<Item = &Self>) -> T, ) -> T

This is a lower level API that other functions rely on for their implementation.

Source

fn children_count(&self) -> usize

This is a lower level API that other functions rely on for their implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§