pub struct PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,{ /* private fields */ }
Expand description
Postgres event store implementation.
Implementations§
Source§impl<Tls> PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Trait Implementations§
Source§impl<Tls> Clone for PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Clone,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> Clone for PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Clone,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Source§fn clone(&self) -> PgEventStore<Tls>
fn clone(&self) -> PgEventStore<Tls>
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<Tls> EventStore for PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> EventStore for PgEventStore<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Source§fn load_events<'life0, 'life1, 'async_trait, A>(
&'life0 self,
id: Option<&'life1 <A as Aggregate>::ID>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateEventEnvelope<A>>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_events<'life0, 'life1, 'async_trait, A>(
&'life0 self,
id: Option<&'life1 <A as Aggregate>::ID>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateEventEnvelope<A>>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load events for a given aggregate. Read more
Source§fn load_events_by_id<'life0, 'life1, 'async_trait, A>(
&'life0 self,
ids: &'life1 [usize],
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateEventEnvelope<A>>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_events_by_id<'life0, 'life1, 'async_trait, A>(
&'life0 self,
ids: &'life1 [usize],
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateEventEnvelope<A>>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load events by ids.
Source§fn load_aggregate_sequence<'life0, 'life1, 'async_trait, A>(
&'life0 self,
id: &'life1 <A as Aggregate>::ID,
) -> Pin<Box<dyn Future<Output = Result<Option<usize>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_aggregate_sequence<'life0, 'life1, 'async_trait, A>(
&'life0 self,
id: &'life1 <A as Aggregate>::ID,
) -> Pin<Box<dyn Future<Output = Result<Option<usize>, Self::Error>> + Send + 'async_trait>>where
A: Aggregate + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads an aggregates latest sequence.
Source§fn save_events<'life0, 'life1, 'life2, 'async_trait, A>(
&'life0 self,
id: &'life1 <A as Aggregate>::ID,
events: &'life2 [<A as Aggregate>::Event],
) -> Pin<Box<dyn Future<Output = Result<Vec<usize>, Self::Error>> + Send + 'async_trait>>
fn save_events<'life0, 'life1, 'life2, 'async_trait, A>( &'life0 self, id: &'life1 <A as Aggregate>::ID, events: &'life2 [<A as Aggregate>::Event], ) -> Pin<Box<dyn Future<Output = Result<Vec<usize>, Self::Error>> + Send + 'async_trait>>
Saves events for a given aggregate instance.
Source§fn execute<'life0, 'async_trait, A, C, R>(
&'life0 self,
id: <A as Aggregate>::ID,
cmd: C,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + Send + Sync + 'async_trait,
<A as Aggregate>::ID: Clone,
<A as Aggregate>::Event: Clone + DeserializeOwned + Serialize,
C: FnOnce(&A) -> R + Send + 'async_trait,
R: Clone + IntoEvents<<A as Aggregate>::Event> + Send + 'async_trait,
Self: Sync + 'async_trait,
fn execute<'life0, 'async_trait, A, C, R>(
&'life0 self,
id: <A as Aggregate>::ID,
cmd: C,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + Send + Sync + 'async_trait,
<A as Aggregate>::ID: Clone,
<A as Aggregate>::Event: Clone + DeserializeOwned + Serialize,
C: FnOnce(&A) -> R + Send + 'async_trait,
R: Clone + IntoEvents<<A as Aggregate>::Event> + Send + 'async_trait,
Self: Sync + 'async_trait,
Loads an aggregate by replaying all events.
Source§fn load_event_by_id<'life0, 'async_trait, A>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<EventEnvelope<<A as Aggregate>::Event>>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: Sync + 'async_trait,
fn load_event_by_id<'life0, 'async_trait, A>(
&'life0 self,
id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<EventEnvelope<<A as Aggregate>::Event>>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: Sync + 'async_trait,
Load events by ids.
Source§fn load_aggregate<'life0, 'async_trait, A>(
&'life0 self,
id: <A as Aggregate>::ID,
) -> Pin<Box<dyn Future<Output = Result<Option<A>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: Sync + 'async_trait,
fn load_aggregate<'life0, 'async_trait, A>(
&'life0 self,
id: <A as Aggregate>::ID,
) -> Pin<Box<dyn Future<Output = Result<Option<A>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
<A as Aggregate>::Event: DeserializeOwned,
Self: Sync + 'async_trait,
Loads an aggregate by replaying all events.
Auto Trait Implementations§
impl<Tls> Freeze for PgEventStore<Tls>
impl<Tls> !RefUnwindSafe for PgEventStore<Tls>
impl<Tls> Send for PgEventStore<Tls>
impl<Tls> Sync for PgEventStore<Tls>
impl<Tls> Unpin for PgEventStore<Tls>
impl<Tls> !UnwindSafe for PgEventStore<Tls>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request