pub enum Rule {
}Variants§
Pattern(Pattern)
Kind(KindMatcher)
Regex(RegexMatcher)
NthChild(NthChild)
Range(RangeMatcher)
Inside(Box<Inside>)
Has(Box<Has>)
Precedes(Box<Precedes>)
Follows(Box<Follows>)
All(All<Rule>)
Any(Any<Rule>)
Not(Box<Not<Rule>>)
Matches(ReferentRule)
Implementations§
Source§impl Rule
impl Rule
pub fn defined_vars(&self) -> HashSet<&str>
Sourcepub fn verify_util(&self) -> Result<(), RuleSerializeError>
pub fn verify_util(&self) -> Result<(), RuleSerializeError>
check if util rules used are defined
Trait Implementations§
Source§impl Default for Rule
Rule matches nothing by default.
In Math jargon, Rule is vacuously false.
impl Default for Rule
Rule matches nothing by default. In Math jargon, Rule is vacuously false.
Source§impl Matcher for Rule
impl Matcher for Rule
Source§fn match_node_with_env<'tree, D: Doc>(
&self,
node: Node<'tree, D>,
env: &mut Cow<'_, MetaVarEnv<'tree, D>>,
) -> Option<Node<'tree, D>>
fn match_node_with_env<'tree, D: Doc>( &self, node: Node<'tree, D>, env: &mut Cow<'_, MetaVarEnv<'tree, D>>, ) -> Option<Node<'tree, D>>
Returns the node why the input is matched or None if not matched.
The return value is usually input node itself, but it can be different node.
For example
Has matcher can return the child or descendant node.Source§fn potential_kinds(&self) -> Option<BitSet>
fn potential_kinds(&self) -> Option<BitSet>
Returns a bitset for all possible target node kind ids.
Returns None if the matcher needs to try against all node kind.
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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