#[non_exhaustive]pub enum ErrorKind {
KeyLength,
Radix,
Length,
ValueRange,
TweakLength,
Alphabet,
AlphabetRequired,
}Expand description
What kind of input was rejected.
One variant per exception class in the fpr-ff1 Python package, so code
ported between the two maps each exception to exactly one kind:
| Kind | Python exception |
|---|---|
KeyLength | KeyLengthError |
Radix | RadixError |
Length | LengthError |
ValueRange | ValueRangeError |
TweakLength | TweakLengthError |
Alphabet | AlphabetError |
AlphabetRequired | FF1Error (the base class) |
Python’s BackendError has no counterpart: backend selection is a
Python-side concern.
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.
KeyLength
The key is not 16, 24 or 32 bytes.
Radix
The radix is outside 2 <= radix < 2**16.
Length
The input length is below the minimum domain for the radix, or above
2**32 - 1.
ValueRange
A numeral is not less than the radix, or a character is not in the alphabet.
TweakLength
A tweak or a tweak-length bound is outside the configured bounds or above the four-byte encodable maximum.
Alphabet
The alphabet’s length does not equal the radix, or a character repeats.
AlphabetRequired
The string interface was used without an alphabet.
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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