pub struct Locator { /* private fields */ }Expand description
A URI identifying one access route to a resource.
A locator of an image-sequence resource names its directory and carries
the SequenceNaming of the files there; no other locator has a naming.
Implementations§
Source§impl Locator
impl Locator
Sourcepub fn new(
id: LocatorId,
resource_id: ResourceId,
uri: impl Into<String>,
last_seen: Option<Timestamp>,
availability: LocatorAvailability,
) -> Result<Self>
pub fn new( id: LocatorId, resource_id: ResourceId, uri: impl Into<String>, last_seen: Option<Timestamp>, availability: LocatorAvailability, ) -> Result<Self>
Creates a locator with a syntactically valid absolute URI.
§Errors
Returns an error when uri is invalid or relative.
Sourcepub fn with_sequence_naming(self, naming: SequenceNaming) -> Self
pub fn with_sequence_naming(self, naming: SequenceNaming) -> Self
Records how the files of the image sequence at this locator are named.
Sourcepub fn with_media_root(self, name: impl Into<String>) -> Result<Self>
pub fn with_media_root(self, name: impl Into<String>) -> Result<Self>
Associates this locator with the logical root used to discover it.
§Errors
Returns an invalid-argument error for an invalid logical root name.
Sourcepub const fn resource_id(&self) -> ResourceId
pub const fn resource_id(&self) -> ResourceId
Returns the resource made accessible by this locator.
Sourcepub const fn last_seen(&self) -> Option<Timestamp>
pub const fn last_seen(&self) -> Option<Timestamp>
Returns when the locator was last observed online.
Sourcepub const fn availability(&self) -> LocatorAvailability
pub const fn availability(&self) -> LocatorAvailability
Returns its last observed availability.
Sourcepub fn media_root(&self) -> Option<&str>
pub fn media_root(&self) -> Option<&str>
Returns the logical media root that located this URI, when recorded.
Sourcepub const fn sequence_naming(&self) -> Option<&SequenceNaming>
pub const fn sequence_naming(&self) -> Option<&SequenceNaming>
Returns the naming of the sequence files at this locator, present exactly for a locator of an image-sequence resource.