pub enum Error {
BufferTooSmall {
min: usize,
len: usize,
},
InvalidDataSize {
expected: usize,
got: usize,
},
InvalidCharacter {
char: char,
index: usize,
},
MissingPrefix {
char: char,
got: Option<char>,
},
InvalidVersion {
expected: &'static str,
version: u8,
},
InsufficientData {
min: usize,
len: usize,
},
ChecksumMismatch {
expected: Checksum,
got: Checksum,
},
}Expand description
Error variants for fallible Crockford Base32 operations.
Variants§
BufferTooSmall
The buffer size is insufficient for the operation.
§Fields
min- The minimum required buffer size.len- The actual size of the provided buffer.
InvalidDataSize
The input data size doesn’t match the expected size.
§Fields
expected- The expected data size in bytes.got- The actual size of the provided data.
InvalidCharacter
An invalid character was encountered during decoding.
§Fields
char- The invalid character found in the input.index- The byte index of the character.
MissingPrefix
The expected prefix character is missing.
§Fields
char- The expected prefix character.got- The actual first character found.
InvalidVersion
Available on crate feature
check only.The provided version byte is invalid.
§Fields
expected- The expected version constraints.version- The invalid version byte.
InsufficientData
Available on crate feature
check only.The input has fewer bytes than are required.
§Fields
min- The minimum required amount of bytes.len- The actual number of bytes provided.
ChecksumMismatch
Available on crate feature
check only.The computed checksum does not match the expected sum.
§Fields
expected- The expected checksum.got- The actual checksum.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Ord for Error
impl Ord for Error
Source§impl PartialOrd for Error
impl PartialOrd for Error
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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