Skip to main content

UnpackError

Enum UnpackError 

Source
pub enum UnpackError<T> {
    NoIdMatch(T),
    NoCast(Box<dyn Any + Send>),
    DeserError(SerError),
}
Expand description

An error that is thrown when deserialisation of a NetMessage is attempted.

Variants§

§

NoIdMatch(T)

ser_id did not match the given Deserialiser.

§

NoCast(Box<dyn Any + Send>)

Box<dyn Any>::downcast() failed.

§

DeserError(SerError)

An error occurred during deserialisation of the buffer.

This can not contain T, as the buffer may have been corrupted during the failed attempt.

Implementations§

Source§

impl<T> UnpackError<T>

Source

pub fn get(self) -> Option<T>

Retrieve the wrapped T instance, if any

Source

pub fn get_box(self) -> Option<Box<dyn Any + Send>>

Retrieve a wrapped any box, if there is any

Trait Implementations§

Source§

impl<T> Debug for UnpackError<T>
where T: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for UnpackError<T>

§

impl<T> !RefUnwindSafe for UnpackError<T>

§

impl<T> !Send for UnpackError<T>

§

impl<T> !Sync for UnpackError<T>

§

impl<T> Unpin for UnpackError<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for UnpackError<T>
where T: UnsafeUnpin,

§

impl<T> !UnwindSafe for UnpackError<T>

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Erased for T