pub enum Node {
Show 15 variants
Empty,
Char(char),
Any,
Class(bool, Vec<(char, char)>),
Set(Box<ClassSet>),
Property {
kind: PropertyKind,
negated: bool,
},
Start,
End,
WordBoundary(bool),
Group {
index: Option<usize>,
node: Box<Node>,
},
Concat(Vec<Node>),
Alt(Vec<Node>),
Repeat {
node: Box<Node>,
min: u32,
max: Option<u32>,
greedy: bool,
},
Backref(usize),
Look {
node: Box<Node>,
ahead: bool,
negated: bool,
},
}Expand description
One node of the pattern’s syntax tree.
Variants§
Empty
Matches nothing: the identity of a concatenation.
Char(char)
A literal character.
Any
.
Class(bool, Vec<(char, char)>)
[...], or a bare \d-style escape. The flag says whether the set is inverted.
Set(Box<ClassSet>)
A v-mode character class: sets, nesting, &&, -- and \q{…} strings.
Property
\p{Name} / \P{Name}: a Unicode property escape.
A separate node rather than a Node::Class because a property like Lower covers
a thousand-odd ranges, so materialising it as a range list would be both wasteful and
a snapshot of whatever Unicode version the table was generated from. The matcher asks
the property directly instead.
Start
^
End
$
WordBoundary(bool)
\b when true, \B when false.
Group
(…) with a capture index, or (?:…) with none.
Fields
Concat(Vec<Node>)
A sequence.
Alt(Vec<Node>)
a|b
Repeat
*, +, ?, {n,m}, greedy or lazy.
Fields
Backref(usize)
\1
Look
(?=…) / (?!…).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for Node
impl Freeze for Node
impl Move for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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