Skip to main content

EffectAdapter

Struct EffectAdapter 

Source
pub struct EffectAdapter {
    inner: Arc<dyn DatabaseOperations>,
    effects: Vec<Mutation>,
    resource: Option<ResourceBinding>,
}
Expand description

Binds app-declared inserts to each domain write transaction. Read-only operations never emit effects, and domain result indices remain unchanged.

Fields§

§inner: Arc<dyn DatabaseOperations>§effects: Vec<Mutation>§resource: Option<ResourceBinding>

Implementations§

Source§

impl EffectAdapter

Source

pub fn new( inner: Arc<dyn DatabaseOperations>, schema: &AppSchema, effects: Vec<Mutation>, ) -> Result<Self, DatabaseError>

Accepts a bounded insertion-only outbox plan with local identity references.

Source

pub fn with_resource( self, schema: &AppSchema, resource: ResourceBinding, ) -> Result<Self, DatabaseError>

Binds one declared resource to its generated domain identity at commit.

Trait Implementations§

Source§

impl DatabaseOperations for EffectAdapter

Source§

fn backend_name(&self) -> &'static str

Delegates backend name through the same configured operation interface.

Source§

fn local_artifact_format(&self) -> Option<&'static str>

Preserves the underlying adapter artifact contract through this wrapper.

Source§

fn ensure_database( &self, config: &DbBackendConfig, schema: &AppSchema, ) -> Result<(), DatabaseError>

Delegates ensure database through the same configured operation interface.

Source§

fn user_credentials( &self, config: &DbBackendConfig, schema: &AppSchema, username: &str, ) -> Result<Option<UserCredentials>, DatabaseError>

Delegates user credentials through the same configured operation interface.

Source§

fn update_user_password( &self, config: &DbBackendConfig, user_id: i64, password_hash: &str, ) -> Result<(), DatabaseError>

Delegates update user password through the same configured operation interface.

Source§

fn issue_session( &self, config: &DbBackendConfig, user_id: i64, session_token_hash: &str, expires_at: &str, ) -> Result<(), DatabaseError>

Delegates issue session through the same configured operation interface.

Source§

fn revoke_session( &self, config: &DbBackendConfig, session_token_hash: &str, ) -> Result<(), DatabaseError>

Delegates revoke session through the same configured operation interface.

Source§

fn revoke_user_sessions( &self, config: &DbBackendConfig, user_id: i64, ) -> Result<(), DatabaseError>

Delegates revoke user sessions through the same configured operation interface.

Source§

fn active_session( &self, config: &DbBackendConfig, schema: &AppSchema, session_token_hash: &str, now_epoch_seconds: u64, ) -> Result<Option<ActiveSession>, DatabaseError>

Delegates active session through the same configured operation interface.

Source§

fn append_rate_limit_event( &self, config: &DbBackendConfig, policy_key: &str, bucket_key: &str, outcome: &str, ) -> Result<(), DatabaseError>

Delegates append rate limit event through the same configured operation interface.

Source§

fn admit_rate_limited_request( &self, config: &DbBackendConfig, policy_key: &str, bucket_key: &str, maximum: usize, window_seconds: u64, ) -> Result<bool, DatabaseError>

Delegates admit rate limited request through the same configured operation interface.

Source§

fn apply_contract( &self, config: &DbBackendConfig, contract: &AppDataContract, ) -> Result<(), DatabaseError>

Delegates apply contract through the same configured operation interface.

Source§

fn migration_ledger( &self, config: &DbBackendConfig, app_id: &str, ) -> Result<BTreeMap<String, String>, DatabaseError>

Delegates migration ledger through the same configured operation interface.

Source§

fn applied_migration_checksum( &self, config: &DbBackendConfig, app_id: &str, migration_id: &str, ) -> Result<Option<String>, DatabaseError>

Delegates applied migration checksum through the same configured operation interface.

Source§

fn verify_contract( &self, config: &DbBackendConfig, contract: &AppDataContract, ) -> Result<(), DatabaseError>

Delegates verify contract through the same configured operation interface.

Source§

fn ready( &self, config: &DbBackendConfig, schema: &AppSchema, ) -> Result<(), DatabaseError>

Delegates ready through the same configured operation interface.

Source§

fn field_exists( &self, config: &DbBackendConfig, schema: &AppSchema, entity_name: &str, field_name: &str, ) -> Result<bool, DatabaseError>

Delegates field exists through the same configured operation interface.

Source§

fn migrate( &self, config: &DbBackendConfig, schema: &AppSchema, migration: &Migration, ) -> Result<(), DatabaseError>

Delegates migrate through the same configured operation interface.

Source§

fn adopt_legacy_migration( &self, config: &DbBackendConfig, schema: &AppSchema, migration: &Migration, expected_legacy: &BTreeMap<String, String>, ) -> Result<(), DatabaseError>

Delegates adopt legacy migration through the same configured operation interface.

Source§

fn query( &self, config: &DbBackendConfig, schema: &AppSchema, query: &Query, ) -> Result<Vec<Map<String, Value>>, DatabaseError>

Delegates query through the same configured operation interface.

Source§

fn join_query( &self, config: &DbBackendConfig, schema: &AppSchema, request: &JoinedQuery, ) -> Result<Vec<JoinedRecord>, DatabaseError>

Delegates join query through the same configured operation interface.

Source§

fn aggregate( &self, config: &DbBackendConfig, schema: &AppSchema, query: &AggregateQuery, ) -> Result<Value, DatabaseError>

Delegates aggregate through the same configured operation interface.

Source§

fn transact( &self, config: &DbBackendConfig, schema: &AppSchema, transaction: &Transaction, ) -> Result<TransactionResult, DatabaseError>

Delegates transact through the same configured operation interface.

Source§

fn claim_one( &self, config: &DbBackendConfig, schema: &AppSchema, claim: &Claim, ) -> Result<Option<i64>, DatabaseError>

Delegates claim one through the same configured operation interface.

Source§

fn export_page( &self, config: &DbBackendConfig, schema: &AppSchema, entity: &str, after_identity: Option<Value>, limit: u32, ) -> Result<Vec<Record>, DatabaseError>

Delegates export page through the same configured operation interface.

Source§

fn export_snapshot( &self, config: &DbBackendConfig, schema: &AppSchema, limits: SnapshotLimits, ) -> Result<Vec<Record>, DatabaseError>

Delegates export snapshot through the same configured operation interface.

Source§

fn restore_snapshot( &self, config: &DbBackendConfig, schema: &AppSchema, records: &[Record], limits: SnapshotLimits, counts: &[RestoreCount], ) -> Result<(), DatabaseError>

Delegates restore snapshot through the same configured operation interface.

Source§

fn import_batch( &self, config: &DbBackendConfig, schema: &AppSchema, records: &[Record], ) -> Result<(), DatabaseError>

Delegates import batch through the same configured operation interface.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.