pub struct MutationIntent { /* private fields */ }Expand description
In-memory intent that must be durably inserted before acknowledgement.
Implementations§
Source§impl MutationIntent
impl MutationIntent
Sourcepub const fn new(
operation_id: OperationId,
idempotency_key: IdempotencyKey,
origin: MutationOrigin,
session_generation: SessionGeneration,
desired: DesiredMutation,
preconditions: MutationPreconditions,
) -> Self
pub const fn new( operation_id: OperationId, idempotency_key: IdempotencyKey, origin: MutationOrigin, session_generation: SessionGeneration, desired: DesiredMutation, preconditions: MutationPreconditions, ) -> Self
Creates an intent. Call Self::validate_for_persistence before durable insertion.
Sourcepub fn with_local_content(self, local_content: LocalContentSnapshot) -> Self
pub fn with_local_content(self, local_content: LocalContentSnapshot) -> Self
Attaches an owned local-content reference.
Sourcepub fn with_platform_correlation(
self,
platform_correlation: PlatformRequestCorrelation,
) -> Self
pub fn with_platform_correlation( self, platform_correlation: PlatformRequestCorrelation, ) -> Self
Attaches an owned platform correlation token.
Sourcepub fn with_remote_reconciliation_key(
self,
remote_reconciliation_key: RemoteReconciliationKey,
) -> Self
pub fn with_remote_reconciliation_key( self, remote_reconciliation_key: RemoteReconciliationKey, ) -> Self
Attaches a backend status/change-feed reconciliation key.
Sourcepub fn with_retry(self, retry: MutationRetryMetadata) -> Self
pub fn with_retry(self, retry: MutationRetryMetadata) -> Self
Replaces persisted retry metadata.
Sourcepub fn validate_for_persistence(&self) -> Result<()>
pub fn validate_for_persistence(&self) -> Result<()>
Validates invariants needed before the intent becomes recoverable.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn operation_id(&self) -> &OperationId
pub const fn operation_id(&self) -> &OperationId
Returns the operation identity.
Sourcepub const fn idempotency_key(&self) -> &IdempotencyKey
pub const fn idempotency_key(&self) -> &IdempotencyKey
Returns the backend idempotency key.
Sourcepub const fn origin(&self) -> MutationOrigin
pub const fn origin(&self) -> MutationOrigin
Returns how the mutation entered the shared mechanism.
Sourcepub const fn session_generation(&self) -> SessionGeneration
pub const fn session_generation(&self) -> SessionGeneration
Returns the platform session generation captured by the intent.
Sourcepub const fn desired(&self) -> &DesiredMutation
pub const fn desired(&self) -> &DesiredMutation
Returns the desired product-neutral mutation.
Sourcepub const fn preconditions(&self) -> &MutationPreconditions
pub const fn preconditions(&self) -> &MutationPreconditions
Returns independent metadata/content revision preconditions.
Sourcepub const fn local_content(&self) -> Option<&LocalContentSnapshot>
pub const fn local_content(&self) -> Option<&LocalContentSnapshot>
Returns the owned local-content reference, when needed.
Sourcepub const fn platform_correlation(&self) -> Option<&PlatformRequestCorrelation>
pub const fn platform_correlation(&self) -> Option<&PlatformRequestCorrelation>
Returns the owned platform request correlation token.
Sourcepub const fn remote_reconciliation_key(
&self,
) -> Option<&RemoteReconciliationKey>
pub const fn remote_reconciliation_key( &self, ) -> Option<&RemoteReconciliationKey>
Returns the remote status/change-feed reconciliation key.
Sourcepub const fn retry(&self) -> &MutationRetryMetadata
pub const fn retry(&self) -> &MutationRetryMetadata
Returns persisted retry metadata.
Trait Implementations§
Source§impl Clone for MutationIntent
impl Clone for MutationIntent
Source§fn clone(&self) -> MutationIntent
fn clone(&self) -> MutationIntent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more