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, MessageParseError>;
fn into_rel(self) -> Rel;
}
Expand description
A trait for parsing relations with full context needed for tree building. This includes extensions, the parsed pair, input children, and output field count.
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, MessageParseError>
fn parse_pair_with_context( extensions: &SimpleExtensions, pair: Pair<'_, Rule>, input_children: Vec<Box<Rel>>, input_field_count: usize, ) -> Result<Self, MessageParseError>
Parse a relation with full context for tree building.
Args:
- extensions: The extensions context
- pair: The parsed pest pair
- input_children: The input relations (for wiring)
- input_field_count: Number of output fields from input children (for output mapping)
fn into_rel(self) -> 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.