Skip to main content

OperationHandler

Trait OperationHandler 

Source
pub trait OperationHandler<O>: Send + Sync
where O: DomainOperation,
{ // Required methods fn authorize<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, auth: &'life1 AuthContext, operation: &'life2 O, envelope: &'life3 OperationEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, auth: &'life1 AuthContext, operation: &'life2 O, envelope: &'life3 OperationEnvelope, current: Option<&'life4 CurrentEntity>, ) -> Pin<Box<dyn Future<Output = Result<AuthoritativeMutation, ExecutionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; }
Expand description

Authorization and execution logic for one typed domain command.

This compatibility boundary does not receive a captured execution context and therefore does not, by itself, qualify for full deterministic replay. New replayable authority paths should implement aequora_replay::ReplayHandler, persist its ExecutionPlan through a native atomic commit, and keep this handler only as an integration facade where required.

Required Methods§

Source

fn authorize<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, auth: &'life1 AuthContext, operation: &'life2 O, envelope: &'life3 OperationEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Authorizes the decoded command before authoritative entity state is read.

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, auth: &'life1 AuthContext, operation: &'life2 O, envelope: &'life3 OperationEnvelope, current: Option<&'life4 CurrentEntity>, ) -> Pin<Box<dyn Future<Output = Result<AuthoritativeMutation, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Validates and executes the decoded command against current authoritative state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§