Trait texlang::parse::Parsable

source ·
pub trait Parsable<S: TexlangState>: Sized {
    // Required method
    fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>;

    // Provided method
    fn parse<I>(input: &mut I) -> Result<Self, Box<Error>>
       where I: AsMut<ExpandedStream<S>> { ... }
}
Expand description

Implementations of this trait are elements of the TeX grammar than can be parsed from a stream of tokens.

Required Methods§

source

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

Parses a value from the vm::ExpandedStream.

Provided Methods§

source

fn parse<I>(input: &mut I) -> Result<Self, Box<Error>>where I: AsMut<ExpandedStream<S>>,

Parses a value from an input stream.

This method just delegates to Parsable::parse_impl.

Implementations on Foreign Types§

source§

impl<S: TexlangState> Parsable<S> for Vec<Token>

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState> Parsable<S> for char

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState, T1: Parsable<S>, T2: Parsable<S>, T3: Parsable<S>, T4: Parsable<S>, T5: Parsable<S>> Parsable<S> for (T1, T2, T3, T4, T5)

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState> Parsable<S> for i32

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState> Parsable<S> for Ordering

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState, T3: Parsable<S>, T4: Parsable<S>, T5: Parsable<S>> Parsable<S> for (T3, T4, T5)

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState, T4: Parsable<S>, T5: Parsable<S>> Parsable<S> for (T4, T5)

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

source§

impl<S: TexlangState, T2: Parsable<S>, T3: Parsable<S>, T4: Parsable<S>, T5: Parsable<S>> Parsable<S> for (T2, T3, T4, T5)

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

Implementors§