Skip to main content

ValueSource

Trait ValueSource 

Source
pub trait ValueSource: ObjectSource {
    // Required methods
    fn locate(&self, object: &(dyn Reflect + 'static)) -> Vec<ArrayLocation>;
    fn metadata(&self, location: &ArrayLocation) -> Result<ArrayMetadata, Error>;
    fn read(&self, location: &ArrayLocation) -> Result<ArrayData, Error>;
    fn read_into(
        &self,
        location: &ArrayLocation,
        out: &mut ArrayBuffer<'_>,
    ) -> Result<ArrayMetadata, Error>;
}
Expand description

Reading the arrays an object points at.

Sits on top of ObjectSource because a derived array - a boolean written as the indices that are true, an integer array written as a mask - needs both: the numbers, and sometimes the object holding them.

One trait for both EPC and ETP, again: the layers above name this and nothing else, so the transport is a decision made once, where the store is built.

Required Methods§

Source

fn locate(&self, object: &(dyn Reflect + 'static)) -> Vec<ArrayLocation>

Every external part this array points at, resolved to a file.

A list rather than one: eml 2.3 lets a single logical array be spread over several ExternalDataArrayParts.

Source

fn metadata(&self, location: &ArrayLocation) -> Result<ArrayMetadata, Error>

Shape and element type, without reading the values.

Source

fn read(&self, location: &ArrayLocation) -> Result<ArrayData, Error>

Read one part.

Source

fn read_into( &self, location: &ArrayLocation, out: &mut ArrayBuffer<'_>, ) -> Result<ArrayMetadata, Error>

Read one part into a buffer the caller already owns.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ArraySource for EpcStore

Source§

fn locate(&self, object: &(dyn Reflect + 'static)) -> Vec<ArrayLocation>

Source§

fn metadata(&self, location: &ArrayLocation) -> Result<ArrayMetadata, Error>

Source§

fn read(&self, location: &ArrayLocation) -> Result<ArrayData, Error>

Source§

fn read_into( &self, location: &ArrayLocation, out: &mut ArrayBuffer<'_>, ) -> Result<ArrayMetadata, Error>

Implementors§