pub struct Node<'input, Rule: RuleType, Data> { /* private fields */ }
Expand description
A node of the parse tree.
Implementations§
Source§impl<'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> ⓘ
pub fn into_children(self) -> Nodes<'i, R, D> ⓘ
Returns an iterator over the children of this node
Sourcepub fn children(&self) -> Nodes<'i, R, D> ⓘwhere
D: Clone,
pub fn children(&self) -> Nodes<'i, R, D> ⓘwhere
D: Clone,
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§
Source§impl<'input, Rule: PartialEq + RuleType, Data: PartialEq> PartialEq for Node<'input, Rule, Data>
impl<'input, Rule: PartialEq + RuleType, Data: PartialEq> PartialEq for Node<'input, Rule, Data>
impl<'input, Rule: Eq + RuleType, Data: Eq> Eq for Node<'input, Rule, Data>
impl<'input, Rule: RuleType, Data> StructuralPartialEq for Node<'input, Rule, Data>
Auto Trait Implementations§
impl<'input, Rule, Data> Freeze for Node<'input, Rule, Data>where
Data: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more