Trait ndarray_npy::ReadableElement
source · pub trait ReadableElement: Sized {
// Required method
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§
sourcefn 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_descdoes not matchSelf - if the
readerhas fewer elements thanlen - if the
readerhas extra bytes after readinglenelements
Object Safety§
This trait is not object safe.