pub trait Parse: Sized {
// Required method
fn parse(parser: &mut Parser) -> Result<Self, ParseErr>;
}
Expand description
Components that can be constructed from a sequence of tokens.
Required Methods§
Sourcefn parse(parser: &mut Parser) -> Result<Self, ParseErr>
fn parse(parser: &mut Parser) -> Result<Self, ParseErr>
Attempt to convert the next sequence of tokens in the parser’s state into a component.
If parsing fails, there are no guarantees about what happens to the input, and the parser likely should not be used after an error is raised during parsing.
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.