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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.