pub struct NodePredicate(/* private fields */);Implementations§
Source§impl NodePredicate
impl NodePredicate
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 NodePredicate
impl NodePredicate
Sourcepub fn operator_token(&self) -> Option<SyntaxToken>
pub fn operator_token(&self) -> Option<SyntaxToken>
Returns the operator token.
Sourcepub fn operator(&self) -> Option<PredicateOp>
pub fn operator(&self) -> Option<PredicateOp>
Returns the operator kind.
Sourcepub fn string_value(&self) -> Option<SyntaxToken>
pub fn string_value(&self) -> Option<SyntaxToken>
Returns the string value if the predicate uses a string.
Sourcepub fn regex(&self) -> Option<RegexLiteral>
pub fn regex(&self) -> Option<RegexLiteral>
Returns the regex literal if the predicate uses a regex.
Sourcepub fn value<'q>(&self, source: &'q str) -> Option<PredicateValue<'q>>
pub fn value<'q>(&self, source: &'q str) -> Option<PredicateValue<'q>>
Returns the predicate value (string or regex pattern).
Trait Implementations§
Source§impl Clone for NodePredicate
impl Clone for NodePredicate
Source§fn clone(&self) -> NodePredicate
fn clone(&self) -> NodePredicate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodePredicate
impl Debug for NodePredicate
Source§impl Hash for NodePredicate
impl Hash for NodePredicate
Source§impl PartialEq for NodePredicate
impl PartialEq for NodePredicate
impl Eq for NodePredicate
impl StructuralPartialEq for NodePredicate
Auto Trait Implementations§
impl Freeze for NodePredicate
impl !RefUnwindSafe for NodePredicate
impl !Send for NodePredicate
impl !Sync for NodePredicate
impl Unpin for NodePredicate
impl !UnwindSafe for NodePredicate
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.