Skip to main content

ProductionStoreTransaction

Trait ProductionStoreTransaction 

Source
pub trait ProductionStoreTransaction {
Show 18 methods // Required methods fn id(&self) -> TransactionId; fn state(&self) -> TransactionState; fn set_revision_context(&mut self, context: RevisionContext) -> Result<()>; fn import_original(&mut self, import: &OriginalMediaImport) -> Result<()>; fn add_representation( &mut self, import: &RepresentationImport, ) -> Result<()>; fn add_locator(&mut self, locator: &Locator) -> Result<()>; fn retire_locator(&mut self, locator_id: LocatorId) -> Result<()>; fn add_media_root(&mut self, root: MediaRoot) -> Result<()>; fn set_media_root_enabled( &mut self, root_id: MediaRootId, enabled: bool, ) -> Result<()>; fn remove_media_root(&mut self, root_id: MediaRootId) -> Result<()>; fn add_external_identifier( &mut self, target: ObjectRef, identifier: &ExternalIdentifier, ) -> Result<()>; fn remove_external_identifier( &mut self, target: ObjectRef, identifier: &ExternalIdentifier, ) -> Result<()>; fn add_metadata_value( &mut self, target: ObjectRef, property: &MetadataProperty, value: &MetadataValue, ) -> Result<()>; fn replace_metadata_values( &mut self, target: ObjectRef, property: &MetadataProperty, values: &[MetadataValue], ) -> Result<()>; fn remove_metadata_property( &mut self, target: ObjectRef, property: &MetadataProperty, ) -> Result<()>; fn create_activity(&mut self, activity: &Activity) -> Result<()>; fn commit(&mut self) -> Result<()>; fn rollback(&mut self) -> Result<()>;
}
Expand description

Transactional mutation operations required from a persistence backend.

Required Methods§

Source

fn id(&self) -> TransactionId

Returns this transaction’s stable identity.

Source

fn state(&self) -> TransactionState

Returns the current lifecycle state.

Source

fn set_revision_context(&mut self, context: RevisionContext) -> Result<()>

Sets the origin and message for the revision created on commit.

§Errors

Returns a domain error when the transaction is already closed.

Source

fn import_original(&mut self, import: &OriginalMediaImport) -> Result<()>

Stages one prepared original-media aggregate atomically.

§Errors

Returns a domain error when the transaction is closed or persistence rejects the aggregate.

Source

fn add_representation(&mut self, import: &RepresentationImport) -> Result<()>

Stages a representation and its newly imported resources on an existing asset.

§Errors

Returns a domain error when the transaction is closed, the owning asset does not exist, or persistence rejects the aggregate.

Source

fn add_locator(&mut self, locator: &Locator) -> Result<()>

Stages an explicitly confirmed resource locator.

§Errors

Returns a domain error when the transaction is closed or persistence rejects the locator.

Source

fn retire_locator(&mut self, locator_id: LocatorId) -> Result<()>

Stages retirement of one superseded resource locator.

§Errors

Returns a domain error when the transaction is closed, the locator does not exist, or persistence fails.

Source

fn add_media_root(&mut self, root: MediaRoot) -> Result<()>

Stages a configured resolver search root.

§Errors

Returns a domain error when the transaction is closed or persistence rejects the root.

Source

fn set_media_root_enabled( &mut self, root_id: MediaRootId, enabled: bool, ) -> Result<()>

Enables or disables a configured resolver search root.

Setting the existing state is an idempotent no-op.

§Errors

Returns a domain error when the transaction is closed, the root does not exist, or persistence fails.

Source

fn remove_media_root(&mut self, root_id: MediaRootId) -> Result<()>

Stages removal of a configured resolver search root.

§Errors

Returns a domain error when the transaction is closed, the root does not exist, or persistence fails.

Source

fn add_external_identifier( &mut self, target: ObjectRef, identifier: &ExternalIdentifier, ) -> Result<()>

Stages an external identifier attachment.

§Errors

Returns a domain error when the transaction is closed, the target does not exist, the attachment already exists, or persistence fails.

Source

fn remove_external_identifier( &mut self, target: ObjectRef, identifier: &ExternalIdentifier, ) -> Result<()>

Stages removal of one exact external identifier attachment.

§Errors

Returns a domain error when the transaction is closed, the attachment does not exist, the target kind is unsupported, or persistence fails.

Source

fn add_metadata_value( &mut self, target: ObjectRef, property: &MetadataProperty, value: &MetadataValue, ) -> Result<()>

Appends one value to an object’s metadata property.

§Errors

Returns a domain error when the transaction is closed, the target does not exist or is unsupported, encoding fails, or persistence fails.

Source

fn replace_metadata_values( &mut self, target: ObjectRef, property: &MetadataProperty, values: &[MetadataValue], ) -> Result<()>

Atomically replaces all values of one metadata property.

An empty value slice removes the property.

§Errors

Returns a domain error when the transaction is closed, the target does not exist or is unsupported, encoding fails, or persistence fails.

Source

fn remove_metadata_property( &mut self, target: ObjectRef, property: &MetadataProperty, ) -> Result<()>

Removes all values of one metadata property.

§Errors

Returns a domain error when the transaction is closed, the property is absent, the target kind is unsupported, or persistence fails.

Source

fn create_activity(&mut self, activity: &Activity) -> Result<()>

Stages a complete production activity with its input and output edges.

§Errors

Returns a domain error when the transaction is closed, a referenced representation is absent, the activity already exists, its edges would create a provenance cycle, or persistence fails.

Source

fn commit(&mut self) -> Result<()>

Atomically makes every staged mutation durable.

§Errors

Returns a domain error when the transaction is closed or commit fails.

Source

fn rollback(&mut self) -> Result<()>

Explicitly discards every staged mutation.

§Errors

Returns a domain error when the transaction is closed or rollback fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§