Enum DecodeError

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(usize, 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.

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.

Implementations

impl Clone for DecodeError

fn clone(self: &Self) -> DecodeError

impl Debug for DecodeError

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Display for DecodeError

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for DecodeError

impl Error for DecodeError

impl Freeze for DecodeError

impl PartialEq for DecodeError

fn eq(self: &Self, other: &DecodeError) -> bool

impl RefUnwindSafe for DecodeError

impl Send for DecodeError

impl StructuralPartialEq for DecodeError

impl Sync for DecodeError

impl Unpin for DecodeError

impl UnsafeUnpin for DecodeError

impl UnwindSafe for DecodeError

impl<T> Any for DecodeError

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for DecodeError

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for DecodeError

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for DecodeError

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for DecodeError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for DecodeError

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for DecodeError

fn to_string(self: &Self) -> String

impl<T, U> Into for DecodeError

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for DecodeError

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for DecodeError

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>