pub enum KindPredicate {
Kind(NodeKind),
Union(Vec<NodeKind>),
Not(Box<Self>),
Context(ContextPredicate),
FormatSpecific(FormatSpecificKind),
}Expand description
Kind predicate for filtering nodes by type
Variants§
Kind(NodeKind)
Match a specific node kind
Union(Vec<NodeKind>)
Match any of several kinds (union)
Not(Box<Self>)
Match all except this kind (negation)
Context(ContextPredicate)
Context-aware filter
FormatSpecific(FormatSpecificKind)
Format-specific predicate (namespaced)
Implementations§
Source§impl KindPredicate
impl KindPredicate
Sourcepub fn matches(&self, kind: NodeKind, context: ParsingContext) -> bool
pub fn matches(&self, kind: NodeKind, context: ParsingContext) -> bool
Check if a node kind matches this predicate
Trait Implementations§
Source§impl Clone for KindPredicate
impl Clone for KindPredicate
Source§fn clone(&self) -> KindPredicate
fn clone(&self) -> KindPredicate
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 KindPredicate
impl Debug for KindPredicate
Source§impl PartialEq for KindPredicate
impl PartialEq for KindPredicate
impl Eq for KindPredicate
impl StructuralPartialEq for KindPredicate
Auto Trait Implementations§
impl Freeze for KindPredicate
impl RefUnwindSafe for KindPredicate
impl Send for KindPredicate
impl Sync for KindPredicate
impl Unpin for KindPredicate
impl UnwindSafe for KindPredicate
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