Skip to main content

EffectStore

Trait EffectStore 

Source
pub trait EffectStore: Send + Sync {
    // Required methods
    fn load(
        &self,
        id: EffectId,
    ) -> Result<Option<EffectRecord>, EffectExecutorError>;
    fn find_by_idempotency(
        &self,
        capability_id: CapabilityId,
        key: &str,
    ) -> Result<Option<EffectRecord>, EffectExecutorError>;
    fn compare_and_swap(
        &self,
        record: &EffectRecord,
        expected_revision: Option<u64>,
    ) -> Result<(), EffectExecutorError>;
}
Expand description

Atomic persistence boundary for write-ahead effect records.

Required Methods§

Source

fn load( &self, id: EffectId, ) -> Result<Option<EffectRecord>, EffectExecutorError>

Loads a record by effect identity.

§Errors

Returns EffectExecutorError on storage failure.

Source

fn find_by_idempotency( &self, capability_id: CapabilityId, key: &str, ) -> Result<Option<EffectRecord>, EffectExecutorError>

Resolves a logical effect by capability-scoped idempotency key.

§Errors

Returns EffectExecutorError on storage failure.

Source

fn compare_and_swap( &self, record: &EffectRecord, expected_revision: Option<u64>, ) -> Result<(), EffectExecutorError>

Creates or atomically replaces a record.

None is create-only. Updates require the exact current revision and a new revision exactly one greater.

§Errors

Returns EffectExecutorError on storage failure or conflict.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§