Parsable

Trait Parsable 

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

    // Provided method
    fn parse<S: TexlangState, I>(input: &mut I) -> Result<Self>
       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<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Parses a value from the vm::ExpandedStream.

Provided Methods§

Source

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

Parses a value from an input stream.

This method just delegates to Parsable::parse_impl.

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.

Implementations on Foreign Types§

Source§

impl Parsable for Option<CommandRef>

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for Option<char>

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for Option<Font>

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for char

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for i32

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for u8

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for Vec<Token>

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for Glue

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for Scaled

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

impl Parsable for ScaledUnit

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

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

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

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

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

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

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Source§

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

Source§

fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>

Implementors§