#[non_exhaustive]pub enum ViewNpyError {
Io(Error),
ParseHeader(ParseHeaderError),
InvalidData(Box<dyn Error + Send + Sync + 'static>),
LengthOverflow,
WrongNdim(Option<usize>, usize),
WrongDescriptor(Value),
NonNativeEndian,
MisalignedData,
MissingBytes(usize),
ExtraBytes(usize),
}
Expand description
An error viewing a .npy
file.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(Error)
An error caused by I/O.
ParseHeader(ParseHeaderError)
An error parsing the file header.
InvalidData(Box<dyn Error + Send + Sync + 'static>)
Some of the data is invalid for the element type.
LengthOverflow
Overflow while computing the length of the array (in units of bytes or the number of elements) from the shape described in the file header.
WrongNdim(Option<usize>, usize)
An error caused by incorrect Dimension
type.
WrongDescriptor(Value)
The type descriptor does not match the element type.
NonNativeEndian
The type descriptor does not match the native endianness.
MisalignedData
The start of the data is not properly aligned for the element type.
MissingBytes(usize)
The file does not contain all the data described in the header.
ExtraBytes(usize)
Extra bytes are present between the end of the data and the end of the file.
Trait Implementations§
Source§impl Debug for ViewNpyError
impl Debug for ViewNpyError
Source§impl Display for ViewNpyError
impl Display for ViewNpyError
Source§impl Error for ViewNpyError
impl Error for ViewNpyError
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 From<ViewDataError> for ViewNpyError
impl From<ViewDataError> for ViewNpyError
Source§fn from(err: ViewDataError) -> ViewNpyError
fn from(err: ViewDataError) -> ViewNpyError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ViewNpyError
impl !RefUnwindSafe for ViewNpyError
impl Send for ViewNpyError
impl Sync for ViewNpyError
impl Unpin for ViewNpyError
impl !UnwindSafe for ViewNpyError
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