Enum DecodeError
pub enum DecodeError
Errors that can occur while decoding.
Variants
-
InvalidByte(usize, u8) An invalid byte was found in the input. The offset and offending byte are provided.
Padding characters (
=) interspersed in the encoded form are invalid, as they may only be present as the last 0-2 bytes of input.This error may also indicate that extraneous trailing input bytes are present, causing otherwise valid padding to no longer be the last bytes of input.
-
InvalidLength(usize) The length of the input, as measured in valid base64 symbols, is invalid. There must be 2-4 symbols in the last input quad.
-
InvalidLastSymbol { offset: usize, symbol: u8, symbol_value: u8 } The last non-padding input symbol's encoded 6 bits have nonzero bits that will be discarded. This is indicative of corrupted or truncated Base64. Unlike
DecodeError::InvalidByte, which reports symbols that aren't in the alphabet, this error is for symbols that are in the alphabet but represent nonsensical encodings.See
crate::engine::GeneralPurposeConfig::with_decode_allow_trailing_bitsto control whether to detect this encoding error and produce this variant.-
InvalidPadding The nature of the padding was not as configured: absent or incorrect when it must be canonical, or present when it must be absent, etc.
Trait Implementations
impl Clone for DecodeError
fn clone(&self) -> Self
impl Debug for DecodeError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for DecodeError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for DecodeError
impl Error for DecodeError
impl PartialEq for DecodeError
fn eq(&self, other: &Self) -> bool