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;
// Provided methods
fn take_storage_fuel(&self) -> u64 { ... }
fn drain<'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.
Provided Methods§
Sourcefn take_storage_fuel(&self) -> u64
fn take_storage_fuel(&self) -> u64
Additional persistence work, reported once and settled by the host boundary. Storage must not reject a completed native outcome because fuel ran out.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".