Skip to main content

ProductionRead

Trait ProductionRead 

Source
pub trait ProductionRead {
Show 18 methods // Required methods fn production(&self) -> &Production; fn assets(&self) -> Result<Vec<Asset>>; fn representations(&self, asset_id: AssetId) -> Result<Vec<Representation>>; fn resources( &self, representation_id: RepresentationId, ) -> Result<Vec<Resource>>; fn locators(&self, resource_id: ResourceId) -> Result<Vec<Locator>>; fn external_identifiers( &self, target: ObjectRef, ) -> Result<Vec<ExternalIdentifier>>; fn find_by_external_identifier( &self, scheme: &IdentifierScheme, value: &str, ) -> Result<Vec<ObjectRef>>; fn metadata(&self, target: ObjectRef) -> Result<Vec<MetadataAssertion>>; fn metadata_values( &self, target: ObjectRef, property: &MetadataProperty, ) -> Result<Vec<MetadataValue>>; fn query_by_metadata_property( &self, property: &MetadataProperty, ) -> Result<Vec<MetadataMatch>>; fn activities(&self) -> Result<Vec<Activity>>; fn activities_producing( &self, representation_id: RepresentationId, ) -> Result<Vec<Activity>>; fn activities_consuming( &self, representation_id: RepresentationId, ) -> Result<Vec<Activity>>; fn ancestors( &self, representation_id: RepresentationId, ) -> Result<Vec<RepresentationId>>; fn descendants( &self, representation_id: RepresentationId, ) -> Result<Vec<RepresentationId>>; fn latest_revision(&self) -> Result<Option<Revision>>; fn changes_since(&self, sequence: u64, limit: u32) -> Result<Vec<Revision>>; fn events_for_revision( &self, revision_id: RevisionId, ) -> Result<Vec<RevisionEvent>>;
}
Expand description

Read operations required from a production persistence backend.

The contract returns domain values and deliberately contains no generic CRUD, query language, connection, or database-row concepts.

Required Methods§

Source

fn production(&self) -> &Production

Returns the loaded production metadata and configured media roots.

Source

fn assets(&self) -> Result<Vec<Asset>>

Loads all assets in deterministic order.

§Errors

Returns a storage-domain error when persisted data cannot be read or decoded safely.

Source

fn representations(&self, asset_id: AssetId) -> Result<Vec<Representation>>

Loads every representation belonging to an asset in deterministic order.

§Errors

Returns a storage-domain error when persisted data cannot be read or decoded safely.

Source

fn resources( &self, representation_id: RepresentationId, ) -> Result<Vec<Resource>>

Loads resources used by a representation in structural order.

§Errors

Returns a storage-domain error when persisted data cannot be read or decoded safely.

Source

fn locators(&self, resource_id: ResourceId) -> Result<Vec<Locator>>

Loads every known locator belonging to a resource.

§Errors

Returns a storage-domain error when persisted data cannot be read or decoded safely.

Source

fn external_identifiers( &self, target: ObjectRef, ) -> Result<Vec<ExternalIdentifier>>

Loads external identifiers attached to target in deterministic order.

§Errors

Returns a storage-domain error when persisted data cannot be read or decoded safely, or when the target kind is not supported.

Source

fn find_by_external_identifier( &self, scheme: &IdentifierScheme, value: &str, ) -> Result<Vec<ObjectRef>>

Finds objects carrying the exact external scheme and value.

§Errors

Returns a domain error when the lookup value is invalid or persisted data cannot be decoded safely.

Source

fn metadata(&self, target: ObjectRef) -> Result<Vec<MetadataAssertion>>

Loads all metadata assertions attached to target in deterministic order.

§Errors

Returns a domain error when the target kind is unsupported or persisted data cannot be decoded safely.

Source

fn metadata_values( &self, target: ObjectRef, property: &MetadataProperty, ) -> Result<Vec<MetadataValue>>

Loads every ordered value for one property on target.

§Errors

Returns a domain error when the target kind is unsupported or persisted data cannot be decoded safely.

Source

fn query_by_metadata_property( &self, property: &MetadataProperty, ) -> Result<Vec<MetadataMatch>>

Finds every object carrying property, preserving value repetition.

§Errors

Returns a domain error when persisted data cannot be decoded safely.

Source

fn activities(&self) -> Result<Vec<Activity>>

Loads all production activities in deterministic identity order.

§Errors

Returns a storage-domain error when persisted activity data cannot be read or decoded safely.

Source

fn activities_producing( &self, representation_id: RepresentationId, ) -> Result<Vec<Activity>>

Loads activities that produce representation_id.

§Errors

Returns a domain error when the representation is absent or persisted activity data cannot be read safely.

Source

fn activities_consuming( &self, representation_id: RepresentationId, ) -> Result<Vec<Activity>>

Loads activities that consume representation_id.

§Errors

Returns a domain error when the representation is absent or persisted activity data cannot be read safely.

Source

fn ancestors( &self, representation_id: RepresentationId, ) -> Result<Vec<RepresentationId>>

Returns every transitive provenance ancestor of representation_id.

§Errors

Returns a domain error when the representation is absent or persisted provenance cannot be traversed safely.

Source

fn descendants( &self, representation_id: RepresentationId, ) -> Result<Vec<RepresentationId>>

Returns every transitive provenance descendant of representation_id.

§Errors

Returns a domain error when the representation is absent or persisted provenance cannot be traversed safely.

Source

fn latest_revision(&self) -> Result<Option<Revision>>

Returns the newest durable revision, or None for an empty journal.

§Errors

Returns a storage-domain error when persisted revision data is invalid.

Source

fn changes_since(&self, sequence: u64, limit: u32) -> Result<Vec<Revision>>

Returns revisions after sequence in ascending order, capped by limit.

§Errors

Returns a domain error when limit is zero or excessive, or when persisted revision data is invalid.

Source

fn events_for_revision( &self, revision_id: RevisionId, ) -> Result<Vec<RevisionEvent>>

Loads the semantic events for one revision in stable position order.

§Errors

Returns a domain error when the revision is absent or persisted event data is invalid.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§