pub trait EffectHistory: Send + Sync {
// Required methods
fn begin<'life0, 'life1, 'async_trait>(
&'life0 self,
operation: &'life1 str,
fingerprint: [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<EffectCall, HistoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 EffectCall,
outcome: RecordedOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), HistoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn ensure_history_consumed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), HistoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Implementations must serialize calls and commit before complete returns.
A missing outcome is an instruction to execute, regardless of idempotency.
Required Methods§
fn begin<'life0, 'life1, 'async_trait>(
&'life0 self,
operation: &'life1 str,
fingerprint: [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<EffectCall, HistoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 EffectCall,
outcome: RecordedOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), HistoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn ensure_history_consumed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), HistoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ensure_history_consumed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), HistoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Verify that no effect is pending and all recorded calls have been consumed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".