pub enum BlockFormatError {
TooShort {
len: usize,
},
BadMagic,
UnsupportedFormat {
found: u32,
readable: &'static [u32],
},
Truncated {
expected: u64,
actual: u64,
},
ChecksumMismatch,
Malformed(&'static str),
UnknownDtype(u32),
}Expand description
Why a block file was refused. Every variant means “these bytes are not a block this build can read”, and none of them is recoverable by reading harder.
Variants§
TooShort
Shorter than the fixed prefix: there is not even a header to check.
BadMagic
Not a ferrox block file at all.
UnsupportedFormat
Written by a build whose layout this one does not know.
Truncated
The file’s own declared length does not match the bytes present – a half-written or truncated file.
ChecksumMismatch
Right length, wrong bytes: bit rot, an interrupted overwrite, or a file that was edited.
Malformed(&'static str)
Structurally impossible content: a dimension of zero, a body that cannot hold the tensors the header describes.
UnknownDtype(u32)
A dtype code this build has no reader for.
Trait Implementations§
Source§impl Clone for BlockFormatError
impl Clone for BlockFormatError
Source§fn clone(&self) -> BlockFormatError
fn clone(&self) -> BlockFormatError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BlockFormatError
impl Debug for BlockFormatError
Source§impl Display for BlockFormatError
impl Display for BlockFormatError
impl Eq for BlockFormatError
Source§impl Error for BlockFormatError
impl Error for BlockFormatError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for BlockFormatError
impl PartialEq for BlockFormatError
impl StructuralPartialEq for BlockFormatError
Auto Trait Implementations§
impl Freeze for BlockFormatError
impl RefUnwindSafe for BlockFormatError
impl Send for BlockFormatError
impl Sync for BlockFormatError
impl Unpin for BlockFormatError
impl UnsafeUnpin for BlockFormatError
impl UnwindSafe for BlockFormatError
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