Enum ndarray_npy::ViewNpyError [−][src]
#[non_exhaustive]
pub enum ViewNpyError {
Io(Error),
ParseHeader(ParseHeaderError),
InvalidData(Box<dyn Error + Send + Sync + 'static>),
LengthOverflow,
WrongNdim(Option<usize>, usize),
WrongDescriptor(PyValue),
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.
Tuple Fields of Io
0: Error
An error parsing the file header.
Some of the data is invalid for the element type.
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.
An error caused by incorrect Dimension
type.
WrongDescriptor(PyValue)
The type descriptor does not match the element type.
Tuple Fields of WrongDescriptor
0: PyValue
The type descriptor does not match the native endianness.
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.
Tuple Fields of MissingBytes
0: usize
ExtraBytes(usize)
Extra bytes are present between the end of the data and the end of the file.
Tuple Fields of ExtraBytes
0: usize
Trait Implementations
Performs the conversion.