Trait orzir_core::Parse

source ·
pub trait Parse {
    type Item;

    // Required method
    fn parse(
        ctx: &mut Context,
        state: &mut ParseState<'_>
    ) -> ParseResult<Self::Item>;
}
Expand description

The parse trait for all the components in IR.

Required Associated Types§

Required Methods§

source

fn parse( ctx: &mut Context, state: &mut ParseState<'_> ) -> ParseResult<Self::Item>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Parse for f32

§

type Item = f32

source§

fn parse(_: &mut Context, state: &mut ParseState<'_>) -> ParseResult<Self::Item>

source§

impl Parse for usize

§

type Item = usize

source§

fn parse(_: &mut Context, state: &mut ParseState<'_>) -> ParseResult<Self::Item>

source§

impl<T: Parse> Parse for Option<T>

source§

fn parse( ctx: &mut Context, state: &mut ParseState<'_> ) -> ParseResult<Self::Item>

Parsing an optional item.

This will first try to parse the item, and if failed, rollback the stream.

§

type Item = Option<<T as Parse>::Item>

Implementors§