pub enum BlobError {
TooShort,
BadMagic,
ValidityMismatch(u32),
TruncatedMeta,
Decode,
TrailingMeta(usize),
Encode,
}Expand description
Why a blob image did not parse or encode.
Each variant carries what a caller needs to report the failure. The crate does no logging of its own: it never knows which file the bytes came from, so the caller that opened the file owns the diagnostic.
Variants§
TooShort
fewer bytes than the fixed header
BadMagic
leading bytes are not the kind’s magic
ValidityMismatch(u32)
the header’s validity token is not the one the kind requires; carries the token found
TruncatedMeta
header promises more metadata than the image holds
Decode
metadata block is not decodable postcard
TrailingMeta(usize)
metadata decoded without reading the whole block; carries the number of bytes left over
Encode
metadata could not be serialized
Trait Implementations§
impl Copy for BlobError
impl Eq for BlobError
impl StructuralPartialEq for BlobError
Auto Trait Implementations§
impl Freeze for BlobError
impl RefUnwindSafe for BlobError
impl Send for BlobError
impl Sync for BlobError
impl Unpin for BlobError
impl UnsafeUnpin for BlobError
impl UnwindSafe for BlobError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.