Trait ndarray_npy::ReadableElement [−][src]
pub trait ReadableElement: Sized {
fn read_to_end_exact_vec<R: Read>(
reader: R,
type_desc: &PyValue,
len: usize
) -> Result<Vec<Self>, ReadDataError>;
}
Expand description
An array element type that can be read from an .npy
or .npz
file.
Required methods
fn read_to_end_exact_vec<R: Read>(
reader: R,
type_desc: &PyValue,
len: usize
) -> Result<Vec<Self>, ReadDataError>
fn read_to_end_exact_vec<R: Read>(
reader: R,
type_desc: &PyValue,
len: usize
) -> Result<Vec<Self>, ReadDataError>
Reads to the end of the reader
, creating a Vec
of length len
.
This method should return Err(_)
in at least the following cases:
- if the
type_desc
does not matchSelf
- if the
reader
has fewer elements thanlen
- if the
reader
has extra bytes after readinglen
elements