pub enum ClassSet {
Char(char),
Range(char, char),
Property {
kind: PropertyKind,
negated: bool,
},
Predefined {
negated: bool,
ranges: Vec<(char, char)>,
},
Strings(Vec<Vec<char>>),
Union(Vec<ClassSet>),
Intersection(Vec<ClassSet>),
Difference(Box<ClassSet>, Box<ClassSet>),
Negated(Box<ClassSet>),
}Expand description
A character class as the v flag defines it.
v replaces the flat “list of ranges” of the older grammar with a real set algebra, so
[[a-c]&&B] is the intersection of a nested class with a letter and [\q{BC|A}] is a set
of strings rather than characters. That last part is why this cannot collapse into
Node::Class: a member of a set may be two characters long, so matching it consumes a
variable number of them.
Variants§
Char(char)
One character.
Range(char, char)
An inclusive range.
Property
A Unicode property escape.
Predefined
A \d-style predefined set, with its own inversion.
Fields
Strings(Vec<Vec<char>>)
One of several strings, from \q{…}. A member may be longer than one character.
Union(Vec<ClassSet>)
Any member of any operand.
Intersection(Vec<ClassSet>)
Members present in every operand.
Difference(Box<ClassSet>, Box<ClassSet>)
Members of the first operand that the second does not have.
Negated(Box<ClassSet>)
[^…].
Trait Implementations§
Auto Trait Implementations§
impl Forget for ClassSet
impl Freeze for ClassSet
impl Move for ClassSet
impl RefUnwindSafe for ClassSet
impl Send for ClassSet
impl Sync for ClassSet
impl Unpin for ClassSet
impl UnsafeUnpin for ClassSet
impl UnwindSafe for ClassSet
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