Skip to main content

EventSourcedStateStore

Struct EventSourcedStateStore 

Source
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§

Source§

impl<ID, E, ES, SN> EventSourcedStateStore<ID, E, ES, SN>
where ID: EventId, E: Event + Clone + Send + Sync, ES: EventStore<ID, E> + Clone + Sync + Send, SN: SnapshotConfig + Clone,

Source

pub fn new(event_store: ES, snapshot: SN) -> Self

Trait Implementations§

Source§

impl<ID, E, ES, SN> Clone for EventSourcedStateStore<ID, E, ES, SN>
where ID: EventId + Clone, E: Event + Clone + Send + Sync + Clone, ES: EventStore<ID, E> + Clone + Sync + Send + Clone, SN: SnapshotConfig + Clone + Clone,

Source§

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)

Performs copy-assignment from source. Read more
Source§

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§

fn load<'life0, 'async_trait>( &'life0 self, state_query: S, ) -> Pin<Box<dyn Future<Output = Result<LoadedState<ID, S>, BoxDynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads the state based on the provided state query. Read more
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>,

Source§

fn load<'life0, 'async_trait>( &'life0 self, state_query: S, ) -> Pin<Box<dyn Future<Output = Result<LoadedState<ID, S>, BoxDynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads the state based on the provided state query. Read more
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,

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,

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>
where ES: Freeze, SN: Freeze,

§

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>
where ES: Unpin, SN: Unpin, ID: Unpin, E: Unpin,

§

impl<ID, E, ES, SN> UnwindSafe for EventSourcedStateStore<ID, E, ES, SN>
where ES: UnwindSafe, SN: UnwindSafe, ID: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V