pub struct InMemoryEventStore { /* private fields */ }Expand description
In-memory event store implementation (for testing/development)
Implementations§
Source§impl InMemoryEventStore
impl InMemoryEventStore
pub fn new() -> Self
pub fn event_count(&self) -> usize
pub fn snapshot_count(&self) -> usize
Trait Implementations§
Source§impl Debug for InMemoryEventStore
impl Debug for InMemoryEventStore
Source§impl Default for InMemoryEventStore
impl Default for InMemoryEventStore
Source§impl EventStore for InMemoryEventStore
impl EventStore for InMemoryEventStore
Source§fn append_events<'life0, 'async_trait>(
&'life0 self,
events: Vec<DomainEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_events<'life0, 'async_trait>(
&'life0 self,
events: Vec<DomainEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append events to the store
Source§fn read_events<'life0, 'async_trait>(
&'life0 self,
query: EventStreamQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<DomainEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_events<'life0, 'async_trait>(
&'life0 self,
query: EventStreamQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<DomainEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read events from the store
Source§fn get_latest_sequence<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<Option<EventSequence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_latest_sequence<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<Option<EventSequence>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the latest sequence number for an aggregate
Source§fn save_snapshot<'life0, 'async_trait>(
&'life0 self,
snapshot: AggregateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_snapshot<'life0, 'async_trait>(
&'life0 self,
snapshot: AggregateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save a snapshot
Source§fn load_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<Option<AggregateSnapshot>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<Option<AggregateSnapshot>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the latest snapshot for an aggregate
Source§fn aggregate_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn aggregate_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: &'life1 AggregateId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if aggregate exists
Auto Trait Implementations§
impl Freeze for InMemoryEventStore
impl RefUnwindSafe for InMemoryEventStore
impl Send for InMemoryEventStore
impl Sync for InMemoryEventStore
impl Unpin for InMemoryEventStore
impl UnwindSafe for InMemoryEventStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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