#[repr(C, u32)]pub enum Matcher {
Epsilon,
Node {
kind: NodeTypeId,
field: Option<NodeFieldId>,
negated_fields: Slice<NodeFieldId>,
},
Anonymous {
kind: NodeTypeId,
field: Option<NodeFieldId>,
negated_fields: Slice<NodeFieldId>,
},
Wildcard,
}Expand description
Matcher determines what node satisfies a transition.
Navigation (descend/ascend) is handled by Nav, not matchers.
Variants§
Epsilon
Matches without consuming input. Used for control flow transitions.
Node
Matches a named node by kind, optionally constrained by field.
Anonymous
Matches an anonymous node by kind, optionally constrained by field.
Wildcard
Matches any node (named or anonymous).
Implementations§
Source§impl Matcher
impl Matcher
Sourcepub fn consumes_node(&self) -> bool
pub fn consumes_node(&self) -> bool
Returns true if this matcher consumes a node.
Sourcepub fn kind(&self) -> MatcherKind
pub fn kind(&self) -> MatcherKind
Returns the discriminant kind.
Sourcepub fn node_kind(&self) -> Option<NodeTypeId>
pub fn node_kind(&self) -> Option<NodeTypeId>
Returns the node type ID for Node/Anonymous variants, None otherwise.
Sourcepub fn field(&self) -> Option<NodeFieldId>
pub fn field(&self) -> Option<NodeFieldId>
Returns the field constraint, if any.
Sourcepub fn negated_fields(&self) -> Slice<NodeFieldId>
pub fn negated_fields(&self) -> Slice<NodeFieldId>
Returns the negated fields slice. Empty for Epsilon/Wildcard.
Trait Implementations§
impl Copy for Matcher
impl Eq for Matcher
impl StructuralPartialEq for Matcher
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnwindSafe for Matcher
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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§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.