Skip to main content

Algorithm

Trait Algorithm 

Source
pub trait Algorithm {
    type Traversal<'t, L: LanguageExt>: Traversal<'t, StrDoc<L>>;

    // Required method
    fn traverse<L: LanguageExt>(
        node: Node<'_, StrDoc<L>>,
    ) -> Self::Traversal<'_, L>;
}
Expand description

Trait for tree traversal algorithms.

Defines how to create traversal iterators for different algorithms (pre-order, post-order, level-order). Each algorithm has its own traversal implementation with specific visiting order and performance characteristics.

Required Associated Types§

Source

type Traversal<'t, L: LanguageExt>: Traversal<'t, StrDoc<L>>

The specific traversal iterator type for this algorithm

Required Methods§

Source

fn traverse<L: LanguageExt>(node: Node<'_, StrDoc<L>>) -> Self::Traversal<'_, L>

Create a traversal iterator starting from the given node

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§