Struct npyz::NpyData [−][src]
pub struct NpyData<'a, T: Deserialize> { /* fields omitted */ }
use NpyReader instead
Expand description
Legacy type for reading npy
files.
This type provides the same API for reading from
npy-rs 0.4.0
, to help with migration. It will later be removed in favor ofNpyFile
.
The data is internally stored
as a byte array, and deserialized only on-demand to minimize unnecessary allocations.
The whole contents of the file can be deserialized by the NpyData::to_vec
method.
Implementations
Deserialize a NPY file represented as bytes
Returns whether there are zero records in this NpyData structure.
Gets a single data-record with the specified flat index.
Returns None if the index is out of bounds.
Panics
Panics if the bytes stored for the element are invalid for the dtype.
Gets a single data-record with the specified index.
Panics
Panics if the bytes stored for the element are invalid for the dtype, or if the index is out of bounds.
Construct a vector with the deserialized contents of the whole file.
The output is a flat vector with the elements in the same order that they are in the file.
NpyData
is deprecated and does not provide any tools for inspecting the shape and
layout of the data, so if you want to correctly read multi-dimensional arrays you should
switch to NpyFile
.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for NpyData<'a, T> where
<T as Deserialize>::TypeReader: RefUnwindSafe,
impl<'a, T> Send for NpyData<'a, T> where
<T as Deserialize>::TypeReader: Send,
impl<'a, T> Sync for NpyData<'a, T> where
<T as Deserialize>::TypeReader: Sync,
impl<'a, T> Unpin for NpyData<'a, T> where
<T as Deserialize>::TypeReader: Unpin,
impl<'a, T> UnwindSafe for NpyData<'a, T> where
<T as Deserialize>::TypeReader: UnwindSafe,