Trait pest_deconstruct::FromPest[][src]

pub trait FromPest<'a>: Sized {
    type Rule: RuleType;

    const RULE: Self::Rule;

    fn from_pest(pest: Pair<'a, Self::Rule>) -> Self;
}

Convert from the Pest parse tree to a typed AST node.

Associated Types

The rule enum that this AST pairs with.

Associated Constants

The specific rule that this AST represents.

Required Methods

Convert from a Pest parse tree node to a new AST node.

Panics

If pest.as_rule() != <Self as FromPest>::RULE.

Implementors