Skip to main content

ArrayLocation

Struct ArrayLocation 

Source
pub struct ArrayLocation {
    pub file: String,
    pub path_in_file: String,
    pub mime: Option<String>,
    pub start: Vec<i64>,
    pub count: Vec<i64>,
    pub proxy_uuid: Option<String>,
    pub field_path: String,
    pub resource_uri: Option<String>,
}
Expand description

Where one array - or one slice of one - actually lives.

Fields§

§file: String

The file, as the package names it. A bare file name in practice, though the schema suggests a URI; both are accepted.

Empty when the object points at a proxy the caller has not resolved: see locate_with.

§path_in_file: String

Path of the dataset inside the file, e.g. /resqml22/<uuid>/Points.

§mime: Option<String>

MIME type declared for the data - application/x-hdf5, but the field exists precisely so it need not be.

eml 2.3 carries it in the part itself; eml 2.0-2.2 carry it on the EpcExternalPartReference, which is why resolving a proxy yields this as well as the file name (see ProxyTarget).

§start: Vec<i64>

Start index per dimension. Empty means “from the beginning”.

§count: Vec<i64>

Element count per dimension. Empty means “the whole dataset”.

§proxy_uuid: Option<String>

Uuid of the EpcExternalPartReference this came through, for the older form. None for the eml 2.3 form, which has no proxy.

§field_path: String

Dotted path of the array inside the object, for diagnostics: Geometry.Points.Coordinates.

§resource_uri: Option<String>

The ETP address of the array: the URI of the data object whose resource holds it, DataArrayIdentifier.uri, the path being ArrayLocation::path_in_file (pathInResource). Filled by a store that is addressed that way (an ETP dataspace); None for a file, which is addressed by ArrayLocation::file. See ArrayLocation::etp.

TODO(verify): which object’s URI ETP 1.2 expects for the older form, the EpcExternalPartReference or the object pointing at it (ETP 1.2 §13, DataArray; Energistics Identifier Specification).

Implementations§

Source§

impl ArrayLocation

Source

pub fn is_resolved(&self) -> bool

Whether the file is known. It is not, when the object points at a proxy and no resolver was given.

§A shape borrowed from the file, and what ETP will do with it

“Resolved” here means the store filled in a file name, and that is a disk word in a type that is meant to serve a network store too. It is honest for an EPC: the EpcExternalPartReference is a real indirection and following it is a real step, so an unresolved location is a genuine state a caller can be handed.

It does not carry over. An ETP dataspace has no files: a data array is addressed by the URI of the object holding it plus a pathInResource, and GetDataArrays takes exactly that pair. A client filling ArrayLocation::file would be inventing a file name so that is_resolved returns true, which is the wrong way round.

Left as it is, deliberately, rather than generalized on a guess: the choice is between widening file into an opaque “where the store keeps it” string and giving the ETP client its own addressing with a conversion at the seam. Which one is right depends on what the client actually needs to pass to GetDataArrays, and that is settled when the client is written, not before. It is recorded as an open question so it is a decision taken rather than a leak nobody noticed.

Source

pub fn etp( resource_uri: impl Into<String>, path_in_resource: impl Into<String>, ) -> Self

A location addressed the ETP way: the URI of the object whose resource holds the array, and the path inside that resource. The only place the pair becomes a location, so that a store and a server never spell the conversion twice.

Source

pub fn etp_address(&self) -> Option<(&str, &str)>

The ETP address of this location, (uri, pathInResource), when it has one.

Trait Implementations§

Source§

impl Clone for ArrayLocation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ArrayLocation

Source§

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

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

impl Default for ArrayLocation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ArrayLocation

Source§

impl PartialEq for ArrayLocation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ArrayLocation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more