pub trait MutationLogStore: Send + Sync {
// Required methods
fn append<'life0, 'async_trait>(
&'life0 self,
entry: MutationLogEntry,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MutationLogEntry>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
keep_from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<MutationLogEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
MutationLog 存储后端 SPI。
独立于 CheckpointStore,允许不同的持久化策略。
Required Methods§
Sourcefn append<'life0, 'async_trait>(
&'life0 self,
entry: MutationLogEntry,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
entry: MutationLogEntry,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
追加一条 mutation 日志。
Sourcefn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MutationLogEntry>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MutationLogEntry>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
重放 trace 从指定步骤开始的 mutation 日志。
Sourcefn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
keep_from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn truncate<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 TraceId,
keep_from_step: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
截断 trace 的旧日志,保留从指定步骤开始的。
Provided Methods§
Sourcefn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<MutationLogEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<MutationLogEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
批量追加 mutation 日志。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".