#[non_exhaustive]pub enum RandomCodeSpecError {
EmptyCode,
EmptyAlphabet,
AlphabetTooLarge,
NonAsciiAlphabet,
DuplicateAlphabetCharacter,
}Expand description
Validation error for RandomCodeSpec.
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.
EmptyCode
Generated codes must contain at least one character.
EmptyAlphabet
The alphabet must contain at least one character.
AlphabetTooLarge
Rejection sampling supports at most 256 distinct symbols.
NonAsciiAlphabet
Byte-oriented code generation requires an ASCII alphabet.
DuplicateAlphabetCharacter
Duplicate characters would unintentionally weight the alphabet.
Trait Implementations§
Source§impl Clone for RandomCodeSpecError
impl Clone for RandomCodeSpecError
impl Copy for RandomCodeSpecError
Source§impl Debug for RandomCodeSpecError
impl Debug for RandomCodeSpecError
Source§impl Display for RandomCodeSpecError
impl Display for RandomCodeSpecError
impl Eq for RandomCodeSpecError
Source§impl Error for RandomCodeSpecError
impl Error for RandomCodeSpecError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for RandomCodeSpecError
impl PartialEq for RandomCodeSpecError
impl StructuralPartialEq for RandomCodeSpecError
Auto Trait Implementations§
impl Freeze for RandomCodeSpecError
impl RefUnwindSafe for RandomCodeSpecError
impl Send for RandomCodeSpecError
impl Sync for RandomCodeSpecError
impl Unpin for RandomCodeSpecError
impl UnsafeUnpin for RandomCodeSpecError
impl UnwindSafe for RandomCodeSpecError
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