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§
Sourcefn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>
fn parse_impl<S: TexlangState>(input: &mut ExpandedStream<S>) -> Result<Self>
Parses a value from the vm::ExpandedStream.
Provided Methods§
Sourcefn parse<S: TexlangState, I>(input: &mut I) -> Result<Self>where
I: AsMut<ExpandedStream<S>>,
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.