pub trait RelationParsePair: Sized {
// Required methods
fn rule() -> Rule;
fn message() -> &'static str;
fn parse_pair_with_context(
extensions: &SimpleExtensions,
pair: Pair<'_, Rule>,
input_children: Vec<Box<Rel>>,
input_field_count: usize,
) -> Result<(Self, usize), MessageParseError>;
fn into_rel(self, adv_ext: Option<AdvancedExtension>) -> Rel;
}Expand description
A trait for parsing relations with full context for tree building.
Required Methods§
fn rule() -> Rule
fn message() -> &'static str
Sourcefn parse_pair_with_context(
extensions: &SimpleExtensions,
pair: Pair<'_, Rule>,
input_children: Vec<Box<Rel>>,
input_field_count: usize,
) -> Result<(Self, usize), MessageParseError>
fn parse_pair_with_context( extensions: &SimpleExtensions, pair: Pair<'_, Rule>, input_children: Vec<Box<Rel>>, input_field_count: usize, ) -> Result<(Self, usize), MessageParseError>
Parse the grammar pair into this relation type and its output field count.
Returns (Self, usize) where usize is the output field count —
computed during parsing when input_field_count is available.
Sourcefn into_rel(self, adv_ext: Option<AdvancedExtension>) -> Rel
fn into_rel(self, adv_ext: Option<AdvancedExtension>) -> Rel
Consume this parsed relation, apply the advanced extension, and produce
the final Rel.
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.