pub trait EventStore: Send + Sync {
// Required methods
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 EventData,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [EventData],
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
event_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_events_by_time<'life0, 'async_trait>(
&'life0 self,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_all_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WaeResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
事件存储 trait
定义事件持久化存储的接口。
Required Methods§
Sourcefn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 EventData,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 EventData,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
追加事件到存储
Sourcefn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [EventData],
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [EventData],
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
批量追加事件
Sourcefn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
event_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
event_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
获取指定类型的事件流
Sourcefn get_events_by_time<'life0, 'async_trait>(
&'life0 self,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_events_by_time<'life0, 'async_trait>(
&'life0 self,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取指定时间范围的事件
Sourcefn get_all_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WaeResult<Vec<EventData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取所有事件