pub struct InMemoryEventStore { /* private fields */ }Expand description
内存事件存储
基于内存的事件存储实现,用于开发和测试。
Implementations§
Source§impl InMemoryEventStore
impl InMemoryEventStore
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
创建带初始容量的内存事件存储
Trait Implementations§
Source§impl Default for InMemoryEventStore
impl Default for InMemoryEventStore
Source§impl EventStore for InMemoryEventStore
impl EventStore for InMemoryEventStore
Source§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<'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,
追加事件到存储
Source§fn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
new_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,
new_events: &'life1 [EventData],
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
批量追加事件
Source§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<'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,
获取指定类型的事件流
Source§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_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,
获取指定时间范围的事件
Source§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 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,
获取所有事件
Auto Trait Implementations§
impl !Freeze for InMemoryEventStore
impl !RefUnwindSafe for InMemoryEventStore
impl Send for InMemoryEventStore
impl Sync for InMemoryEventStore
impl Unpin for InMemoryEventStore
impl UnsafeUnpin for InMemoryEventStore
impl UnwindSafe for InMemoryEventStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more