pub trait ScopedParsePair: Sized {
// Required methods
fn rule() -> Rule;
fn message() -> &'static str;
fn parse_pair(
extensions: &SimpleExtensions,
pair: Pair<'_, Rule>,
) -> Result<Self, MessageParseError>;
}
Expand description
A trait for types that are parsed from a pest::iterators::Pair<Rule>
that
depends on the context - e.g. extension lookups or other contextual
information. This is used for types that are not directly parsed from the
grammar, but rather require additional context to parse correctly.
Required Methods§
fn rule() -> Rule
fn message() -> &'static str
fn parse_pair( extensions: &SimpleExtensions, pair: Pair<'_, Rule>, ) -> Result<Self, MessageParseError>
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.