pub trait Builder<L: Language> {
// Required method
fn build_incremental(
&self,
text: impl Source,
changed: usize,
cache: IncrementalCache<'_, L>,
) -> OakDiagnostics<L::TypedRoot>;
// Provided method
fn build(&self, text: impl Source) -> OakDiagnostics<L::TypedRoot> { ... }
}Expand description
Builder trait for constructing typed kind trees from source text.
This trait provides a unified interface for building complete kind trees from source text, supporting both full parsing and incremental updates. It coordinates the lexing, parsing, and AST construction phases.
Required Methods§
Sourcefn build_incremental(
&self,
text: impl Source,
changed: usize,
cache: IncrementalCache<'_, L>,
) -> OakDiagnostics<L::TypedRoot>
fn build_incremental( &self, text: impl Source, changed: usize, cache: IncrementalCache<'_, L>, ) -> OakDiagnostics<L::TypedRoot>
Builds a kind tree incrementally using an existing cache.
This method enables efficient re-parsing by reusing information from previous parsing operations, only processing the changed portions of the source text.
§Arguments
text- The source text to parsechanged- The number of bytes that have changed since the last parsecache- The incremental cache containing previous parsing results
§Returns
A diagnostics result containing either the parsed kind tree or errors
Provided Methods§
Sourcefn build(&self, text: impl Source) -> OakDiagnostics<L::TypedRoot>
fn build(&self, text: impl Source) -> OakDiagnostics<L::TypedRoot>
Builds a complete kind tree from the given source text.
This method performs a full parse of the source text, creating a new kind tree from scratch. It uses a default cache configuration.
§Arguments
text- The source text to parse
§Returns
A diagnostics result containing either the parsed kind tree or errors
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.