Struct pest_consume::Node
source · [−]pub struct Node<'input, Rule: RuleType, Data> { /* private fields */ }
Expand description
A node of the parse tree.
Implementations
sourceimpl<'i, R: RuleType, D> Node<'i, R, D>
impl<'i, R: RuleType, D> Node<'i, R, D>
pub fn as_str(&self) -> &'i str
pub fn as_span(&self) -> Span<'i>
pub fn as_rule(&self) -> R
sourcepub fn into_children(self) -> Nodes<'i, R, D>ⓘNotable traits for Nodes<'i, R, D>impl<'i, R, D> Iterator for Nodes<'i, R, D> where
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
pub fn into_children(self) -> Nodes<'i, R, D>ⓘNotable traits for Nodes<'i, R, D>impl<'i, R, D> Iterator for Nodes<'i, R, D> where
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
Returns an iterator over the children of this node
sourcepub fn children(&self) -> Nodes<'i, R, D>ⓘNotable traits for Nodes<'i, R, D>impl<'i, R, D> Iterator for Nodes<'i, R, D> where
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
where
D: Clone,
pub fn children(&self) -> Nodes<'i, R, D>ⓘNotable traits for Nodes<'i, R, D>impl<'i, R, D> Iterator for Nodes<'i, R, D> where
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
where
D: Clone,
R: RuleType,
D: Clone, type Item = Node<'i, R, D>;
Returns an iterator over the children of this node
sourcepub fn error<S: ToString>(&self, message: S) -> Error<R>
pub fn error<S: ToString>(&self, message: S) -> Error<R>
Create an error that points to the span of the node.
pub fn user_data(&self) -> &D
pub fn into_user_data(self) -> D
pub fn as_pair(&self) -> &Pair<'i, R>
pub fn into_pair(self) -> Pair<'i, R>
Trait Implementations
sourceimpl<'input, Rule: PartialEq + RuleType, Data: PartialEq> PartialEq<Node<'input, Rule, Data>> for Node<'input, Rule, Data>
impl<'input, Rule: PartialEq + RuleType, Data: PartialEq> PartialEq<Node<'input, Rule, Data>> for Node<'input, Rule, Data>
impl<'input, Rule: Eq + RuleType, Data: Eq> Eq for Node<'input, Rule, Data>
impl<'input, Rule: RuleType, Data> StructuralEq for Node<'input, Rule, Data>
impl<'input, Rule: RuleType, Data> StructuralPartialEq for Node<'input, Rule, Data>
Auto Trait Implementations
impl<'input, Rule, Data> RefUnwindSafe for Node<'input, Rule, Data> where
Data: RefUnwindSafe,
Rule: RefUnwindSafe,
impl<'input, Rule, Data> !Send for Node<'input, Rule, Data>
impl<'input, Rule, Data> !Sync for Node<'input, Rule, Data>
impl<'input, Rule, Data> Unpin for Node<'input, Rule, Data> where
Data: Unpin,
impl<'input, Rule, Data> UnwindSafe for Node<'input, Rule, Data> where
Data: UnwindSafe,
Rule: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more