#[non_exhaustive]pub enum Alphabet {
Default,
UpperCase,
Decimal,
Latin,
LatinUpperCase,
Custom(String),
}Expand description
Alphabet used in Based number.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Default
"0123456789abcdefghijklmnopqrstuvwxyz"
UpperCase
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Decimal
"0123456789"
Latin
"abcdefghijklmnopqrstuvwxyz"
LatinUpperCase
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Custom(String)
let alphabet = Alphabet::new("abcdefghijklmnopqrstuvwxyz");See: Alphabet::check() or Alphabet::is_valid().
Implementations§
Source§impl Alphabet
impl Alphabet
Sourcepub fn new<T: Into<Alphabet>>(abc: T) -> Self
pub fn new<T: Into<Alphabet>>(abc: T) -> Self
Creates a new Alphabet::Custom.
let alphabet = Alphabet::new("abcdefghijklmnopqrstuvwxyz");Sourcepub fn new_unchecked<T: Into<Alphabet>>(abc: T) -> Self
pub fn new_unchecked<T: Into<Alphabet>>(abc: T) -> Self
Creates a new Alphabet::Custom.
Sourcepub fn check(self) -> Result<Self, AlphabetError>
pub fn check(self) -> Result<Self, AlphabetError>
Checks for repeated characters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Alphabet
impl RefUnwindSafe for Alphabet
impl Send for Alphabet
impl Sync for Alphabet
impl Unpin for Alphabet
impl UnwindSafe for Alphabet
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