Skip to main content

DecodeMessageError

Enum DecodeMessageError 

Source
pub enum DecodeMessageError<'a, C: Decoder> {
    DecodingFailure(C::Error<'a>),
    DecodingRemainder {
        message: C::Message<'a>,
        remainder: Secret<&'a [u8]>,
    },
    MessageTooLong {
        initial: Secret<&'a [u8]>,
    },
    MessagePoisoned {
        discarded: Secret<&'a [u8]>,
    },
}
Expand description

An error returned by Fragmentizer::decode_message.

Variants§

§

DecodingFailure(C::Error<'a>)

The decoder failed decoding the message.

§

DecodingRemainder

Not all bytes of the message were used when decoding the message.

Fields

§message: C::Message<'a>

The decoded message.

§remainder: Secret<&'a [u8]>

The unused bytes.

§

MessageTooLong

Max message size was exceeded and bytes were dropped.

Fields

§initial: Secret<&'a [u8]>
§

MessagePoisoned

The message was explicitly poisoned to prevent decoding.

Fields

§discarded: Secret<&'a [u8]>

Trait Implementations§

Source§

impl<'a, C: Clone + Decoder> Clone for DecodeMessageError<'a, C>
where C::Error<'a>: Clone, C::Message<'a>: Clone,

Source§

fn clone(&self) -> DecodeMessageError<'a, C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, C: Debug + Decoder> Debug for DecodeMessageError<'a, C>
where C::Error<'a>: Debug, C::Message<'a>: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a, C: PartialEq + Decoder> PartialEq for DecodeMessageError<'a, C>
where C::Error<'a>: PartialEq, C::Message<'a>: PartialEq,

Source§

fn eq(&self, other: &DecodeMessageError<'a, C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, C: Eq + Decoder> Eq for DecodeMessageError<'a, C>
where C::Error<'a>: Eq, C::Message<'a>: Eq,

Source§

impl<'a, C: Decoder> StructuralPartialEq for DecodeMessageError<'a, C>

Auto Trait Implementations§

§

impl<'a, C> Freeze for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: Freeze, <C as Decoder>::Message<'a>: Freeze,

§

impl<'a, C> RefUnwindSafe for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: RefUnwindSafe, <C as Decoder>::Message<'a>: RefUnwindSafe,

§

impl<'a, C> Send for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: Send, <C as Decoder>::Message<'a>: Send,

§

impl<'a, C> Sync for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: Sync, <C as Decoder>::Message<'a>: Sync,

§

impl<'a, C> Unpin for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: Unpin, <C as Decoder>::Message<'a>: Unpin,

§

impl<'a, C> UnsafeUnpin for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: UnsafeUnpin, <C as Decoder>::Message<'a>: UnsafeUnpin,

§

impl<'a, C> UnwindSafe for DecodeMessageError<'a, C>
where <C as Decoder>::Error<'a>: UnwindSafe, <C as Decoder>::Message<'a>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.