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: StringThe 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: StringPath 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: StringDotted 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
impl ArrayLocation
Sourcepub fn is_resolved(&self) -> bool
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.
Sourcepub fn etp(
resource_uri: impl Into<String>,
path_in_resource: impl Into<String>,
) -> Self
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.
Sourcepub fn etp_address(&self) -> Option<(&str, &str)>
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
impl Clone for ArrayLocation
Source§impl Debug for ArrayLocation
impl Debug for ArrayLocation
Source§impl Default for ArrayLocation
impl Default for ArrayLocation
impl Eq for ArrayLocation
Source§impl PartialEq for ArrayLocation
impl PartialEq for ArrayLocation
impl StructuralPartialEq for ArrayLocation
Auto Trait Implementations§
impl Freeze for ArrayLocation
impl RefUnwindSafe for ArrayLocation
impl Send for ArrayLocation
impl Sync for ArrayLocation
impl Unpin for ArrayLocation
impl UnsafeUnpin for ArrayLocation
impl UnwindSafe for ArrayLocation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.