Skip to main content

Parser

Trait Parser 

Source
pub trait Parser<T = SourceFile> {
    type Error: Error;

    // Required method
    fn parse_cells(&mut self, cells: CellStream) -> Result<T, Self::Error>;
}
Expand description

A parser backend that produces one typed syntax target.

Backends may construct T directly or adapt their concrete syntax tree through ExternalCstNode and migrate.

Required Associated Types§

Source

type Error: Error

The backend-specific parse failure.

Required Methods§

Source

fn parse_cells(&mut self, cells: CellStream) -> Result<T, Self::Error>

Parses cells into one typed syntax target.

§Errors

Returns the backend’s Self::Error when it cannot produce T.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§