pub enum Base32Error<E> {
DecodeInvalidLen {
len: usize,
},
DecodeInvalidAscii {
byte: u8,
},
DecodeOverflow {
id: E,
},
}Expand description
Errors that can occur while decoding Crockford Base32 strings.
This error type is generic over the decoded ID type E, which allows
including the decoded ID in case of overflow. This can help callers inspect
or log invalid IDs during error handling.
Variants§
DecodeInvalidLen
The input string length was invalid.
Crockford Base32 decodes values in 5-bit chunks. Strings of unexpected length are rejected to avoid silent truncation or padding.
DecodeInvalidAscii
The input contained a character that is not valid Crockford Base32.
Accepts digits 0–9, uppercase letters A–Z, and lowercase letters.
Aliases like O/o → 0 and I/i/L/l → 1 are also supported.
This error is returned when a non-alphanumeric or non-ASCII character
(e.g. @, *, ~) is encountered during decoding.
DecodeOverflow
The decoded value exceeds the valid range for the target ID type.
This occurs when the input string sets reserved or unused high bits.
Fields
id: EThe decoded ID value, which failed validation.
Trait Implementations§
Source§impl<E: Clone> Clone for Base32Error<E>
impl<E: Clone> Clone for Base32Error<E>
Source§fn clone(&self) -> Base32Error<E>
fn clone(&self) -> Base32Error<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more