pub struct EventStore<Id, Event>{ /* private fields */ }Expand description
An in-memory EventStore implementation, backed by an HashMap.
Implementations§
Source§impl<Id, Event> EventStore<Id, Event>
impl<Id, Event> EventStore<Id, Event>
Sourcepub fn new(subscribe_capacity: usize) -> Self
pub fn new(subscribe_capacity: usize) -> Self
Creates a new EventStore with a specified in-memory broadcast channel
size, which will used by the subscribe_all method to notify
of newly append events.
Trait Implementations§
Source§impl<Id, Event: Clone> Clone for EventStore<Id, Event>
impl<Id, Event: Clone> Clone for EventStore<Id, Event>
Source§fn clone(&self) -> EventStore<Id, Event>
fn clone(&self) -> EventStore<Id, Event>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Id, Event: Debug> Debug for EventStore<Id, Event>
impl<Id, Event: Debug> Debug for EventStore<Id, Event>
Source§impl<Id, Event> Default for EventStore<Id, Event>
impl<Id, Event> Default for EventStore<Id, Event>
Source§impl<Id, Event> EventStore for EventStore<Id, Event>
impl<Id, Event> EventStore for EventStore<Id, Event>
Source§type SourceId = Id
type SourceId = Id
Type of the Source id, typically an
AggregateId.Source§type Event = Event
type Event = Event
Event to be stored in the
EventStore, typically an Aggregate::Event.Source§type Error = ConflictError
type Error = ConflictError
Possible errors returned by the
EventStore when requesting operations.Source§fn append(
&mut self,
id: Self::SourceId,
version: Expected,
events: Vec<Self::Event>,
) -> BoxFuture<'_, Result<u32, Self::Error>>
fn append( &mut self, id: Self::SourceId, version: Expected, events: Vec<Self::Event>, ) -> BoxFuture<'_, Result<u32, Self::Error>>
Source§fn stream(
&self,
id: Self::SourceId,
select: Select,
) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
fn stream( &self, id: Self::SourceId, select: Select, ) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
Source§fn stream_all(
&self,
select: Select,
) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
fn stream_all( &self, select: Select, ) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
Source§impl<Id, Event> EventSubscriber for EventStore<Id, Event>
impl<Id, Event> EventSubscriber for EventStore<Id, Event>
Source§type SourceId = Id
type SourceId = Id
Type of the Source id, typically an
AggregateId.Source§type Event = Event
type Event = Event
Event type stored in the
EventStore, typically an Aggregate::Event.Source§type Error = SubscriberError
type Error = SubscriberError
Possible errors returned when receiving events from the notification channel.
Source§fn subscribe_all(
&self,
) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
fn subscribe_all( &self, ) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
Subscribes to all new events persisted in the
EventStore, from
the moment of calling this function, in the future. Read moreAuto Trait Implementations§
impl<Id, Event> Freeze for EventStore<Id, Event>
impl<Id, Event> !RefUnwindSafe for EventStore<Id, Event>
impl<Id, Event> Send for EventStore<Id, Event>
impl<Id, Event> Sync for EventStore<Id, Event>
impl<Id, Event> Unpin for EventStore<Id, Event>
impl<Id, Event> !UnwindSafe for EventStore<Id, Event>
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