pub struct EventSourcedStateStore<ID, E, ES, SN>where
ID: EventId,
E: Event + Clone + Send + Sync,
ES: EventStore<ID, E> + Clone + Sync + Send,
SN: SnapshotConfig + Clone,{ /* private fields */ }Expand description
Represents an event sourced decision state store. It loads and stores decision states from events in a event store.
Implementations§
Trait Implementations§
Source§impl<ID, E, ES, SN> Clone for EventSourcedStateStore<ID, E, ES, SN>
impl<ID, E, ES, SN> Clone for EventSourcedStateStore<ID, E, ES, SN>
Source§fn clone(&self) -> EventSourcedStateStore<ID, E, ES, SN>
fn clone(&self) -> EventSourcedStateStore<ID, E, ES, SN>
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, ES, E, S> LoadState<ID, S, E> for EventSourcedStateStore<ID, E, ES, NoSnapshot>where
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
ID: EventId,
E: Event + Clone + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E>,
impl<ID, ES, E, S> LoadState<ID, S, E> for EventSourcedStateStore<ID, E, ES, NoSnapshot>where
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
ID: EventId,
E: Event + Clone + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E>,
Source§impl<ID, ES, E, S, B> LoadState<ID, S, E> for EventSourcedStateStore<ID, E, ES, WithSnapshot<ID, B>>where
ID: EventId,
B: StateSnapshotter<ID> + Send + Sync + Clone,
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
E: Event + Clone + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E> + MultiStateSnapshot<ID, B>,
impl<ID, ES, E, S, B> LoadState<ID, S, E> for EventSourcedStateStore<ID, E, ES, WithSnapshot<ID, B>>where
ID: EventId,
B: StateSnapshotter<ID> + Send + Sync + Clone,
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
E: Event + Clone + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E> + MultiStateSnapshot<ID, B>,
Source§impl<ID, ES, E, S, SC> PersistDecision<ID, S, E> for EventSourcedStateStore<ID, E, ES, SC>where
ID: EventId,
E: Event + Clone + Send + Sync + 'static,
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E>,
SC: SnapshotConfig + Clone + Send + Sync + 'static,
impl<ID, ES, E, S, SC> PersistDecision<ID, S, E> for EventSourcedStateStore<ID, E, ES, SC>where
ID: EventId,
E: Event + Clone + Send + Sync + 'static,
ES: EventStore<ID, E> + Clone + Sync + Send,
<ES as EventStore<ID, E>>::Error: StdError + Send + Sync + 'static,
S: Send + Sync + Serialize + DeserializeOwned + IntoStatePart<ID, S> + 'static,
<S as IntoStatePart<ID, S>>::Target: Send + Sync + Serialize + DeserializeOwned + IntoState<S> + MultiState<ID, E>,
SC: SnapshotConfig + Clone + Send + Sync + 'static,
Source§fn persist<'life0, 'async_trait>(
&'life0 self,
loaded_state: LoadedState<ID, S>,
events: Vec<E>,
validation_query: Option<StreamQuery<ID, E>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistedEvent<ID, E>>, BoxDynError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn persist<'life0, 'async_trait>(
&'life0 self,
loaded_state: LoadedState<ID, S>,
events: Vec<E>,
validation_query: Option<StreamQuery<ID, E>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistedEvent<ID, E>>, BoxDynError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persists the decision changes to the event store. Read more
Auto Trait Implementations§
impl<ID, E, ES, SN> Freeze for EventSourcedStateStore<ID, E, ES, SN>
impl<ID, E, ES, SN> RefUnwindSafe for EventSourcedStateStore<ID, E, ES, SN>
impl<ID, E, ES, SN> Send for EventSourcedStateStore<ID, E, ES, SN>where
SN: Send,
impl<ID, E, ES, SN> Sync for EventSourcedStateStore<ID, E, ES, SN>where
SN: Sync,
impl<ID, E, ES, SN> Unpin for EventSourcedStateStore<ID, E, ES, SN>
impl<ID, E, ES, SN> UnwindSafe for EventSourcedStateStore<ID, E, ES, SN>
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