pub trait ProductionStoreTransaction {
type Lease: JobLease;
Show 30 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 confirm_locator(&mut self, locator: &Locator) -> Result<bool>;
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 record_dependency_set(
&mut self,
representation_id: RepresentationId,
dependencies: &[Dependency],
) -> Result<bool>;
fn record_resource_fingerprint(
&mut self,
resource_id: ResourceId,
fingerprint: &ResourceFingerprint,
) -> Result<bool>;
fn record_resource_file_facts(
&mut self,
resource_id: ResourceId,
facts: FileFacts,
) -> Result<bool>;
fn record_representation_fingerprint(
&mut self,
representation_id: RepresentationId,
fingerprint: &RepresentationFingerprint,
) -> Result<bool>;
fn request_job(&mut self, job: &Job) -> Result<()>;
fn claim_job_lease(
&mut self,
job: JobId,
tool: &ToolIdentity,
agent: Option<&AgentIdentity>,
duration: Duration,
) -> Result<Self::Lease>;
fn renew_job_lease(
&mut self,
lease: &Self::Lease,
duration: Duration,
) -> Result<()>;
fn release_job_lease(&mut self, lease: &Self::Lease) -> Result<()>;
fn fail_job_lease(
&mut self,
lease: &Self::Lease,
failure: &JobFailure,
) -> Result<()>;
fn complete_job_lease(
&mut self,
lease: &Self::Lease,
output: &RepresentationImport,
activity: &Activity,
) -> Result<()>;
fn cancel_job(&mut self, job_id: JobId) -> Result<()>;
fn commit(&mut self) -> Result<CommitReceipt>;
fn rollback(&mut self) -> Result<()>;
}Expand description
Transactional mutation operations required from a persistence backend.
Required Associated Types§
Required Methods§
Sourcefn id(&self) -> TransactionId
fn id(&self) -> TransactionId
Returns this transaction’s stable identity.
Sourcefn state(&self) -> TransactionState
fn state(&self) -> TransactionState
Returns the current lifecycle state.
Sourcefn set_revision_context(&mut self, context: RevisionContext) -> Result<()>
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.
Sourcefn import_original(&mut self, import: &OriginalMediaImport) -> Result<()>
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.
Sourcefn add_representation(&mut self, import: &RepresentationImport) -> Result<()>
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.
Sourcefn add_locator(&mut self, locator: &Locator) -> Result<()>
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.
Sourcefn confirm_locator(&mut self, locator: &Locator) -> Result<bool>
fn confirm_locator(&mut self, locator: &Locator) -> Result<bool>
Confirms a locator from a read-bound decision, preserving identical facts.
Returns false for an existing resource/URI/naming identity and true for a new location. An unchanged confirmation still guards the locator set; it does not rewrite root annotations, availability or last-seen facts.
§Errors
Rejects absent decision bases, invalid/missing resources and storage errors.
Sourcefn retire_locator(&mut self, locator_id: LocatorId) -> Result<()>
fn retire_locator(&mut self, locator_id: LocatorId) -> Result<()>
Stages retirement of one superseded resource locator.
Requires a decision base. Early rejection leaves the transaction open.
§Errors
Returns a domain error when the transaction is closed, the locator does not exist, or persistence fails.
Sourcefn add_media_root(&mut self, root: MediaRoot) -> Result<()>
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.
Sourcefn set_media_root_enabled(
&mut self,
root_id: MediaRootId,
enabled: bool,
) -> Result<()>
fn set_media_root_enabled( &mut self, root_id: MediaRootId, enabled: bool, ) -> Result<()>
Enables or disables a configured resolver search root.
Requires an edit with a decision base. Setting the existing state is an idempotent no-op; early rejection leaves the transaction open.
§Errors
Returns a domain error when the transaction is closed, the root does not exist, or persistence fails.
Sourcefn remove_media_root(&mut self, root_id: MediaRootId) -> Result<()>
fn remove_media_root(&mut self, root_id: MediaRootId) -> Result<()>
Stages removal of a configured resolver search root. Requires an edit with a decision base; early rejection leaves it open.
§Errors
Returns a domain error when the transaction is closed, the root does not exist, or persistence fails.
Sourcefn add_external_identifier(
&mut self,
target: ObjectRef,
identifier: &ExternalIdentifier,
) -> Result<()>
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.
Sourcefn remove_external_identifier(
&mut self,
target: ObjectRef,
identifier: &ExternalIdentifier,
) -> Result<()>
fn remove_external_identifier( &mut self, target: ObjectRef, identifier: &ExternalIdentifier, ) -> Result<()>
Stages removal of one exact external identifier attachment.
Requires a decision base. Early rejection leaves the transaction open.
§Errors
Returns a domain error when the transaction is closed, the attachment does not exist, the target kind is unsupported, or persistence fails.
Sourcefn add_metadata_value(
&mut self,
target: ObjectRef,
property: &MetadataProperty,
value: &MetadataValue,
) -> Result<()>
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.
Sourcefn replace_metadata_values(
&mut self,
target: ObjectRef,
property: &MetadataProperty,
values: &[MetadataValue],
) -> Result<()>
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. Requires a decision base; unbased transactions may append values.
§Errors
Returns a domain error when a decision base is absent, the transaction is closed, the target is absent/unsupported, or encoding/persistence fails.
Sourcefn remove_metadata_property(
&mut self,
target: ObjectRef,
property: &MetadataProperty,
) -> Result<()>
fn remove_metadata_property( &mut self, target: ObjectRef, property: &MetadataProperty, ) -> Result<()>
Removes all values of one metadata property. Requires a decision base.
§Errors
Returns a domain error when a decision base is absent, the transaction is closed, the property is absent, or the target/persistence fails.
Sourcefn create_activity(&mut self, activity: &Activity) -> Result<()>
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.
Sourcefn record_dependency_set(
&mut self,
representation_id: RepresentationId,
dependencies: &[Dependency],
) -> Result<bool>
fn record_dependency_set( &mut self, representation_id: RepresentationId, dependencies: &[Dependency], ) -> Result<bool>
Replaces one representation’s complete ordered dependency observation.
Returns true when state changed and false for an identical current
observation. An empty slice explicitly records a known empty set.
Requires a decision base, including initial and unchanged observations;
early rejection leaves the transaction open.
§Errors
Returns a domain error when the transaction is closed, a referenced object is absent or inconsistent, or persistence fails.
Sourcefn record_resource_fingerprint(
&mut self,
resource_id: ResourceId,
fingerprint: &ResourceFingerprint,
) -> Result<bool>
fn record_resource_fingerprint( &mut self, resource_id: ResourceId, fingerprint: &ResourceFingerprint, ) -> Result<bool>
Records a resource fingerprint as the current observation in its domain.
Requires a decision base, including first and unchanged observations.
Returns true when state changed and false for an identical no-op.
§Errors
Returns a domain error when the transaction is closed, the resource is absent, or persistence fails.
Sourcefn record_resource_file_facts(
&mut self,
resource_id: ResourceId,
facts: FileFacts,
) -> Result<bool>
fn record_resource_file_facts( &mut self, resource_id: ResourceId, facts: FileFacts, ) -> Result<bool>
Records a resource’s current size and modification time as part of a content observation. Changed facts emit an event and guard the resource’s file-facts conflict key. Requires a decision base; facts have no history.
Returns true when state changed and false for identical facts.
§Errors
Returns a domain error when the transaction is closed, the resource is absent, or persistence fails.
Sourcefn record_representation_fingerprint(
&mut self,
representation_id: RepresentationId,
fingerprint: &RepresentationFingerprint,
) -> Result<bool>
fn record_representation_fingerprint( &mut self, representation_id: RepresentationId, fingerprint: &RepresentationFingerprint, ) -> Result<bool>
Records a representation fingerprint as the current observation.
Requires a decision base, including first and unchanged observations.
Returns true when state changed and false for an identical no-op.
A changed observation clears that representation’s recomputation marker.
§Errors
Returns a domain error when the transaction is closed, the representation is absent, or persistence fails.
Sourcefn request_job(&mut self, job: &Job) -> Result<()>
fn request_job(&mut self, job: &Job) -> Result<()>
Stages one requested job with its canonical inputs.
§Errors
Returns a domain error when the transaction is closed, the supplied job is not requested, a referenced object is absent, the job already exists, or persistence fails.
Sourcefn claim_job_lease(
&mut self,
job: JobId,
tool: &ToolIdentity,
agent: Option<&AgentIdentity>,
duration: Duration,
) -> Result<Self::Lease>
fn claim_job_lease( &mut self, job: JobId, tool: &ToolIdentity, agent: Option<&AgentIdentity>, duration: Duration, ) -> Result<Self::Lease>
Claims work for a checked duration using current store authority time.
§Errors
Rejects invalid durations, unavailable jobs, clock rollback or storage errors.
Sourcefn renew_job_lease(
&mut self,
lease: &Self::Lease,
duration: Duration,
) -> Result<()>
fn renew_job_lease( &mut self, lease: &Self::Lease, duration: Duration, ) -> Result<()>
Renews current ownership; the edit must commit before its previous expiry.
§Errors
Rejects wrong scope, expired/superseded ownership, invalid duration or storage errors.
Sourcefn release_job_lease(&mut self, lease: &Self::Lease) -> Result<()>
fn release_job_lease(&mut self, lease: &Self::Lease) -> Result<()>
Releases current unexpired ownership, closing the handle on commit.
§Errors
Rejects wrong scope, expired/superseded ownership or storage errors.
Sourcefn fail_job_lease(
&mut self,
lease: &Self::Lease,
failure: &JobFailure,
) -> Result<()>
fn fail_job_lease( &mut self, lease: &Self::Lease, failure: &JobFailure, ) -> Result<()>
Fails current unexpired ownership, closing the handle on commit.
§Errors
Rejects wrong scope, expired/superseded ownership or storage errors.
Sourcefn complete_job_lease(
&mut self,
lease: &Self::Lease,
output: &RepresentationImport,
activity: &Activity,
) -> Result<()>
fn complete_job_lease( &mut self, lease: &Self::Lease, output: &RepresentationImport, activity: &Activity, ) -> Result<()>
Atomically publishes requested output/provenance and closes ownership.
§Errors
Rejects wrong scope, expired/superseded ownership, invalid facts or storage errors.
Sourcefn cancel_job(&mut self, job_id: JobId) -> Result<()>
fn cancel_job(&mut self, job_id: JobId) -> Result<()>
Cancels a requested or claimed job administratively.
§Errors
Returns a domain error when the job is absent or terminal, the transaction is closed, or persistence fails.
Sourcefn commit(&mut self) -> Result<CommitReceipt>
fn commit(&mut self) -> Result<CommitReceipt>
Commits atomically and returns only the revision this transaction made.
A commit attempt is terminal, including failure. An absent revision in the receipt means that no new revision was created.
§Errors
Returns structured semantic conflicts, closed-state or storage errors.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".