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

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 match Self
  • if the reader has fewer elements than len
  • if the reader has extra bytes after reading len elements

Implementations on Foreign Types

Implementors