pub struct NpyView<'a> { /* private fields */ }
Expand description
Immutable view of memory-mapped .npy
files within an .npz
file.
Does not automatically verify CRC-32 checksum.
Implementations§
Source§impl NpyView<'_>
impl NpyView<'_>
Sourcepub fn status(&self) -> ChecksumStatus
pub fn status(&self) -> ChecksumStatus
CRC-32 checksum status.
Sourcepub fn verify(&mut self) -> Result<u32, ViewNpzError>
pub fn verify(&mut self) -> Result<u32, ViewNpzError>
Verifies and returns CRC-32 checksum by reading the whole array.
Changes checksum status
to Outdated
if invalid or to Correct
if valid.
§Errors
Fails with ZipError::Io
if the checksum is invalid.
Sourcepub fn view<A, D>(&self) -> Result<ArrayView<'_, A, D>, ViewNpzError>where
A: ViewElement,
D: Dimension,
pub fn view<A, D>(&self) -> Result<ArrayView<'_, A, D>, ViewNpzError>where
A: ViewElement,
D: Dimension,
Returns an immutable view of a memory-mapped .npy
file.
Iterates over bool
array to ensure 0x00
/0x01
values.
§Errors
Viewing an .npy
file can fail with ViewNpyError
.
Trait Implementations§
impl<'a> Copy for NpyView<'a>
Auto Trait Implementations§
impl<'a> Freeze for NpyView<'a>
impl<'a> RefUnwindSafe for NpyView<'a>
impl<'a> Send for NpyView<'a>
impl<'a> Sync for NpyView<'a>
impl<'a> Unpin for NpyView<'a>
impl<'a> UnwindSafe for NpyView<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more