Enum packable::prefix::UnpackPrefixError
source · [−]pub enum UnpackPrefixError<T, E> {
Item(T),
Prefix(E),
}
Expand description
Semantic error raised while unpacking dynamically-sized sequences.
Variants
Item(T)
Semantic error raised while unpacking an item of the sequence. Typically this is
Packable::UnpackError
.
Prefix(E)
Semantic error raised when the length prefix cannot be unpacked.
Implementations
sourceimpl<E> UnpackPrefixError<Infallible, E>
impl<E> UnpackPrefixError<Infallible, E>
sourcepub fn into_prefix_err(self) -> E
pub fn into_prefix_err(self) -> E
Projects the value to the Prefix
variant.
sourceimpl<T> UnpackPrefixError<T, Infallible>
impl<T> UnpackPrefixError<T, Infallible>
sourcepub fn into_item_err(self) -> T
pub fn into_item_err(self) -> T
Projects the value to the Item
variant.
sourceimpl<T, E> UnpackPrefixError<T, E>
impl<T, E> UnpackPrefixError<T, E>
sourcepub fn unwrap_item_err_or_else<V: Into<T>>(self, f: impl FnOnce(E) -> V) -> T
pub fn unwrap_item_err_or_else<V: Into<T>>(self, f: impl FnOnce(E) -> V) -> T
Returns the contained Item
value or computes it from a closure.
Trait Implementations
sourceimpl<T: Debug, E: Debug> Debug for UnpackPrefixError<T, E>
impl<T: Debug, E: Debug> Debug for UnpackPrefixError<T, E>
sourceimpl<T: Display, E: Display> Display for UnpackPrefixError<T, E>
impl<T: Display, E: Display> Display for UnpackPrefixError<T, E>
sourceimpl<T, E> From<Infallible> for UnpackPrefixError<T, E>
impl<T, E> From<Infallible> for UnpackPrefixError<T, E>
sourcefn from(err: Infallible) -> Self
fn from(err: Infallible) -> Self
Converts to this type from the input type.
sourceimpl From<UnpackPrefixError<Infallible, Infallible>> for Infallible
impl From<UnpackPrefixError<Infallible, Infallible>> for Infallible
sourcefn from(err: UnpackPrefixError<Infallible, Infallible>) -> Self
fn from(err: UnpackPrefixError<Infallible, Infallible>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<T, E> RefUnwindSafe for UnpackPrefixError<T, E> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for UnpackPrefixError<T, E> where
E: Send,
T: Send,
impl<T, E> Sync for UnpackPrefixError<T, E> where
E: Sync,
T: Sync,
impl<T, E> Unpin for UnpackPrefixError<T, E> where
E: Unpin,
T: Unpin,
impl<T, E> UnwindSafe for UnpackPrefixError<T, E> where
E: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more