pub struct NamedNode(/* private fields */);Implementations§
Source§impl NamedNode
impl NamedNode
pub fn cast(node: SyntaxNode) -> Option<Self>
pub fn can_cast(kind: SyntaxKind) -> bool
pub fn as_cst(&self) -> &SyntaxNode
pub fn text_range(&self) -> TextRange
Source§impl NamedNode
impl NamedNode
pub fn node_type(&self) -> Option<SyntaxToken>
Sourcepub fn is_any(&self) -> bool
pub fn is_any(&self) -> bool
Returns true if the node type is wildcard (_), matching any named node.
Sourcepub fn is_missing(&self) -> bool
pub fn is_missing(&self) -> bool
Returns true if this is a MISSING node: (MISSING ...).
Sourcepub fn missing_constraint(&self) -> Option<SyntaxToken>
pub fn missing_constraint(&self) -> Option<SyntaxToken>
For MISSING nodes, returns the inner type constraint if present.
(MISSING identifier) → Some(“identifier”)
(MISSING ";") → Some(“;”)
(MISSING) → None
pub fn children(&self) -> impl Iterator<Item = Expr> + '_
Sourcepub fn items(&self) -> impl Iterator<Item = SeqItem> + '_
pub fn items(&self) -> impl Iterator<Item = SeqItem> + '_
Returns children interleaved with anchors, preserving order.
Sourcepub fn predicate(&self) -> Option<NodePredicate>
pub fn predicate(&self) -> Option<NodePredicate>
Returns the predicate if present: (identifier == "foo").
Trait Implementations§
impl Eq for NamedNode
impl StructuralPartialEq for NamedNode
Auto Trait Implementations§
impl Freeze for NamedNode
impl !RefUnwindSafe for NamedNode
impl !Send for NamedNode
impl !Sync for NamedNode
impl Unpin for NamedNode
impl !UnwindSafe for NamedNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.