Struct ndarray_npz::NpyView

source ·
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<'a> NpyView<'a>

source

pub fn status(&self) -> ChecksumStatus

CRC-32 checksum status.

source

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.

source

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§

source§

impl<'a> Clone for NpyView<'a>

source§

fn clone(&self) -> NpyView<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for NpyView<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Copy for NpyView<'a>

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.