pub fn read<T, R>(r: &mut R, t: &mut T) -> Result<(), NpyError>where
T: NumpyDtype + NumpyShape + ReadNumbers,
R: Read,
Expand description
Reads data from a Read.
There are a lot of errors that can happen during this process. See NpyError for more info.
The overall process is:
- Read the .npy header.
- Make sure T’s NumpyDtype matches the header’s dtype
- Make sure T’s NumpyShape::shape() matches the header’s shape
- Parse an Endian from header’s “descr” field.
- Read the data using ReadNumbers.
Multiple errors can happen from each of the above parts!