pub enum GroupItem {
Char(char),
Range {
first: char,
last: char,
},
Named {
name: GroupName,
negative: bool,
},
}
Expand description
One item in a character class.
Variants§
Char(char)
A Unicode code point. It can be denoted in quotes (e.g. 'a'
) or in
hexadecimal notation (U+201
).
Some non-printable ASCII characters are also parsed to a
GroupItem::Char
: [n]
, [t]
, [r]
, [a]
, [e]
and [f]
.
Range
A range of Unicode code points. It is denoted as A-B
, where A
and
B
are Unicode code points, allowing the same notation as for
GroupItem::Char
. Both A
and B
are included in the range.
Named
A named character class, i.e. a shorthand or a Unicode
category/script/block. Shorthands are [w]
, [s]
, [d]
, [v]
,
[h]
and [R]
.
Some of them (w
, d
, s
and Unicode) can be negated.
Trait Implementations§
impl Copy for GroupItem
impl Eq for GroupItem
impl StructuralPartialEq for GroupItem
Auto Trait Implementations§
impl Freeze for GroupItem
impl RefUnwindSafe for GroupItem
impl Send for GroupItem
impl Sync for GroupItem
impl Unpin for GroupItem
impl UnwindSafe for GroupItem
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