pub trait Parser<L: Language + Send + Sync + 'static> {
// Required method
fn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<L>,
) -> ParseOutput<'a, L>;
}Expand description
Core parser trait that defines how to run the parser.
Required Methods§
Sourcefn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<L>,
) -> ParseOutput<'a, L>
fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<L>, ) -> ParseOutput<'a, L>
The core parsing entry point.
This method orchestrates the parsing process using the provided cache. It should handle incremental reuse automatically if the cache contains a previous tree.
§Arguments
text- The source textedits- Edits applied to the source since the last parsecache- The cache for resources and incremental reuse
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.