pub enum UnpackError {
Truncated,
CrcMismatch {
expected: u16,
computed: u16,
},
UnknownMode(u8),
}Expand description
Errors returned by unpack when the byte stream is malformed
or fails its integrity check.
Variants§
Truncated
Input was shorter than HEADER_BYTES.
CrcMismatch
CRC-16 over header + payload did not match the transmitted CRC.
UnknownMode(u8)
mode field decoded to an unknown variant. (All four 2-bit
codes are valid by construction, so this should only happen
after a CRC false-positive — kept for forward compatibility
if more modes are ever introduced.)
Trait Implementations§
Source§impl Clone for UnpackError
impl Clone for UnpackError
Source§fn clone(&self) -> UnpackError
fn clone(&self) -> UnpackError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnpackError
impl Debug for UnpackError
Source§impl PartialEq for UnpackError
impl PartialEq for UnpackError
impl Copy for UnpackError
impl Eq for UnpackError
impl StructuralPartialEq for UnpackError
Auto Trait Implementations§
impl Freeze for UnpackError
impl RefUnwindSafe for UnpackError
impl Send for UnpackError
impl Sync for UnpackError
impl Unpin for UnpackError
impl UnsafeUnpin for UnpackError
impl UnwindSafe for UnpackError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more