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§
Sourcefn locate(&self, object: &(dyn Reflect + 'static)) -> Vec<ArrayLocation>
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.
Sourcefn metadata(&self, location: &ArrayLocation) -> Result<ArrayMetadata, Error>
fn metadata(&self, location: &ArrayLocation) -> Result<ArrayMetadata, Error>
Shape and element type, without reading the values.
Sourcefn read_into(
&self,
location: &ArrayLocation,
out: &mut ArrayBuffer<'_>,
) -> Result<ArrayMetadata, Error>
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".