Struct npy::NpyData
[−]
[src]
pub struct NpyData<'a, T> { /* fields omitted */ }
The data structure representing a deserialized npy
file.
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 to_vec
member function.
Methods
impl<'a, T: Serializable> NpyData<'a, T>
[src]
pub fn from_bytes(bytes: &'a [u8]) -> Result<NpyData<'a, T>>
[src]
Deserialize a NPY file represented as bytes
pub fn get(&self, i: usize) -> Option<T>
[src]
Gets a single data-record with the specified index. Returns None, if the index is out of bounds
pub fn len(&self) -> usize
[src]
Returns the total number of records
pub fn is_empty(&self) -> bool
[src]
Returns whether there are zero records in this NpyData structure
pub fn get_unchecked(&self, i: usize) -> T
[src]
Gets a single data-record wit the specified index. Panics, if the index is out of bounds.
pub fn to_vec(&self) -> Vec<T>
[src]
Construct a vector with the deserialized contents of the whole file