Struct pest_deconstruct::PestDeconstructor [−][src]
pub struct PestDeconstructor<'i, R: RuleType> { /* fields omitted */ }
Deconstruct a Pest Pair
into its inner productions in a strongly-typed, panic-enforced manner.
Panics on Drop
if not exhausted.
Use PestDeconstructor::discard
if you mean to ignore productions.
Methods
impl<'i, R: RuleType> PestDeconstructor<'i, R>
[src]
impl<'i, R: RuleType> PestDeconstructor<'i, R>
pub fn next<T: FromPest<'i, Rule = R>>(&mut self) -> T
[src]
pub fn next<T: FromPest<'i, Rule = R>>(&mut self) -> T
Get the next production from this parse tree node.
Useful for Node
productions.
Panics
If there are no remaining productions or the next one is for the wrong rule.
pub fn next_opt<T: FromPest<'i, Rule = R>>(&mut self) -> Option<T>
[src]
pub fn next_opt<T: FromPest<'i, Rule = R>>(&mut self) -> Option<T>
Get the next production from this parse tree node, if it is the correct rule.
Useful for Node?
productions.
pub fn next_many<T: FromPest<'i, Rule = R>>(&mut self) -> Vec<T>
[src]
pub fn next_many<T: FromPest<'i, Rule = R>>(&mut self) -> Vec<T>
Get the next productions from this parse tree of a single rule type. If the next production is for a different rule, returns an empty vector.
Useful for Node*
productions.
pub fn next_pair(&mut self, rule: R) -> Pair<'i, R>
[src]
pub fn next_pair(&mut self, rule: R) -> Pair<'i, R>
Get the next raw Pair
of a certain rule type.
Panics
If there are no remaining productions or the next one is for the wrong rule.
pub fn next_pair_opt(&mut self, rule: R) -> Option<Pair<'i, R>>
[src]
pub fn next_pair_opt(&mut self, rule: R) -> Option<Pair<'i, R>>
Get the next raw Pair
if it matches a certain rule.
pub fn next_pair_many(&mut self, rule: R) -> Vec<Pair<'i, R>>
[src]
pub fn next_pair_many(&mut self, rule: R) -> Vec<Pair<'i, R>>
Get the next raw Pair
s while they match a certain rule.
pub fn next_untyped(&mut self) -> Option<Pair<'i, R>>
[src]
pub fn next_untyped(&mut self) -> Option<Pair<'i, R>>
Get the next production, if it exists.
This works without providing a concrete rule, unlike PestDeconstructor::next_pair
.
pub fn discard(self)
[src]
pub fn discard(self)
Discard the remaining productions in this parse tree node.
Trait Implementations
impl<'i, R: Clone + RuleType> Clone for PestDeconstructor<'i, R>
[src]
impl<'i, R: Clone + RuleType> Clone for PestDeconstructor<'i, R>
fn clone(&self) -> PestDeconstructor<'i, R>
[src]
fn clone(&self) -> PestDeconstructor<'i, R>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'i, R: Debug + RuleType> Debug for PestDeconstructor<'i, R>
[src]
impl<'i, R: Debug + RuleType> Debug for PestDeconstructor<'i, R>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'i, R: RuleType> Drop for PestDeconstructor<'i, R>
[src]
impl<'i, R: RuleType> Drop for PestDeconstructor<'i, R>
Auto Trait Implementations
impl<'i, R> !Send for PestDeconstructor<'i, R>
impl<'i, R> !Send for PestDeconstructor<'i, R>
impl<'i, R> !Sync for PestDeconstructor<'i, R>
impl<'i, R> !Sync for PestDeconstructor<'i, R>