Struct eventually_util::inmemory::EventStore
source · [−]Expand description
An in-memory EventStore implementation, backed by an HashMap.
Implementations
sourceimpl<Id, Event> EventStore<Id, Event> where
Id: Hash + Eq,
impl<Id, Event> EventStore<Id, Event> where
Id: Hash + Eq,
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
sourceimpl<Id: Clone, Event: Clone> Clone for EventStore<Id, Event> where
Id: Hash + Eq,
impl<Id: Clone, Event: Clone> Clone for EventStore<Id, Event> where
Id: Hash + Eq,
sourcefn clone(&self) -> EventStore<Id, Event>
fn clone(&self) -> EventStore<Id, Event>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<Id, Event> Default for EventStore<Id, Event> where
Id: Hash + Eq,
impl<Id, Event> Default for EventStore<Id, Event> where
Id: Hash + Eq,
sourceimpl<Id, Event> EventStore for EventStore<Id, Event> where
Id: Hash + Eq + Sync + Send + Debug + Clone,
Event: Sync + Send + Debug + Clone,
impl<Id, Event> EventStore for EventStore<Id, Event> where
Id: Hash + Eq + Sync + Send + Debug + Clone,
Event: Sync + Send + Debug + Clone,
type SourceId = Id
type SourceId = Id
Type of the Source id, typically an AggregateId. Read more
type Event = Event
type Event = Event
Event to be stored in the EventStore, typically an Aggregate::Event. Read more
type Error = ConflictError
type Error = ConflictError
Possible errors returned by the EventStore when requesting operations.
sourcefn 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>>
sourcefn 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>>
sourcefn stream_all(
&self,
select: Select
) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
fn stream_all(
&self,
select: Select
) -> BoxFuture<'_, Result<EventStream<'_, Self>, Self::Error>>
sourceimpl<Id, Event> EventSubscriber for EventStore<Id, Event> where
Id: Hash + Eq + Sync + Send + Clone,
Event: Sync + Send + Clone,
impl<Id, Event> EventSubscriber for EventStore<Id, Event> where
Id: Hash + Eq + Sync + Send + Clone,
Event: Sync + Send + Clone,
type SourceId = Id
type SourceId = Id
Type of the Source id, typically an AggregateId. Read more
type Event = Event
type Event = Event
Event type stored in the EventStore, typically an Aggregate::Event. Read more
type Error = SubscriberError
type Error = SubscriberError
Possible errors returned when receiving events from the notification channel.
sourcefn 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 more
Auto Trait Implementations
impl<Id, Event> !RefUnwindSafe for EventStore<Id, Event>
impl<Id, Event> Send for EventStore<Id, Event> where
Event: Send + Sync,
Id: Send + Sync,
impl<Id, Event> Sync for EventStore<Id, Event> where
Event: Send + Sync,
Id: Send + Sync,
impl<Id, Event> Unpin for EventStore<Id, Event>
impl<Id, Event> !UnwindSafe for EventStore<Id, Event>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more