Trait Parse

Source
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§

Source

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.

Implementors§

Source§

impl Parse for AsmInstr

Source§

impl Parse for Directive

Source§

impl Parse for StmtKind

Source§

impl Parse for Stmt

Source§

impl<OFF, const N: u32> Parse for PCOffset<OFF, N>
where Offset<OFF, N>: TokenParse,

Source§

impl<S: TokenParse> Parse for S

Source§

impl<const N: u32> Parse for ImmOrReg<N>