pub enum CharsetName {
AlphaLower,
AlphaUpper,
Numeric,
Mathops,
Prose,
Delim,
MiscSpecial,
Alpha,
Special,
}Expand description
Translation layer between chars (e.g. for cli flags) and the actual character sets.
Especially, you can do CharsetName::from::<char>(c). Translations are:
| CharsetName | associated char | contained chars |
|---|---|---|
AlphaLower | 'L' | matching regex [a-z] |
AlphaUpper | 'U' | matching regex [A-Z] |
Numeric | 'N' | matching regex [0-9] |
Mathops | 'M' | +, -, *, /, =, <, > |
Prose | 'P' | ., ,, :, ;, !, ?, ', ", |
Delim | 'D' | (, ), {, }, [, ] |
MiscSpecial | 'X' | #, @, $, %, &, ` |
For convenience, there are also some charsets built from the “atomic” charsets shown above:
| CharsetName | associated char | Contained Charsets |
|---|---|---|
Alpha | 'A' | AlphaLower, AlphaUpper |
Special | 'S' | Mathops, Punct, Delim, Quote, Blank, MiscSpecial |
Variants§
Trait Implementations§
Source§impl AddAssign<CharsetName> for CharsetSpec
impl AddAssign<CharsetName> for CharsetSpec
Source§fn add_assign(&mut self, name: CharsetName)
fn add_assign(&mut self, name: CharsetName)
Performs the
+= operation. Read moreSource§impl Debug for CharsetName
impl Debug for CharsetName
Source§impl PartialEq for CharsetName
impl PartialEq for CharsetName
Source§impl SubAssign<CharsetName> for CharsetSpec
impl SubAssign<CharsetName> for CharsetSpec
Source§fn sub_assign(&mut self, name: CharsetName)
fn sub_assign(&mut self, name: CharsetName)
Performs the
-= operation. Read moreSource§impl TryFrom<char> for CharsetName
impl TryFrom<char> for CharsetName
impl StructuralPartialEq for CharsetName
Auto Trait Implementations§
impl Freeze for CharsetName
impl RefUnwindSafe for CharsetName
impl Send for CharsetName
impl Sync for CharsetName
impl Unpin for CharsetName
impl UnwindSafe for CharsetName
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