Trait fastobo::parser::FromPair

source ·
pub trait FromPair<'i>: Sized {
    const RULE: Rule;

    unsafe fn from_pair_unchecked(
        pair: Pair<'i, Rule>,
        cache: &Cache
    ) -> Result<Self, SyntaxError>; fn from_pair(
        pair: Pair<'i, Rule>,
        cache: &Cache
    ) -> Result<Self, SyntaxError> { ... } }
Expand description

A trait for structures that can be parsed from a pest::Pair.

Required Associated Constants§

The production rule the pair is expected to be obtained from.

Required Methods§

Create a new instance from a Pair without checking the rule.

Safety

May panic if the pair was not produced by the right rule, i.e. pair.as_rule() != <Self as FromPair>::RULE.

Provided Methods§

Create a new instance from a Pair.

Implementations on Foreign Types§

Implementors§