Struct thalo_postgres::PgEventStore [−][src]
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, { /* fields omitted */ }
Expand description
Postgres event store implementation.
Implementations
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
impl<Tls: Clone> Clone 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: Clone> Clone 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,
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,
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,
<A as Aggregate>::Event: DeserializeOwned,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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,
<A as Aggregate>::Event: DeserializeOwned,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Load events for a given aggregate. Read more
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,
<A as Aggregate>::Event: DeserializeOwned,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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,
<A as Aggregate>::Event: DeserializeOwned,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Load events by ids.
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,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads an aggregates latest sequence.
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>> where
A: Aggregate,
<A as Aggregate>::Event: Serialize,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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>> where
A: Aggregate,
<A as Aggregate>::Event: Serialize,
A: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Saves events for a given aggregate instance.
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, Global>> where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
Self: 'async_trait + Sync,
<A as Aggregate>::Event: DeserializeOwned,
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, Global>> where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
Self: 'async_trait + Sync,
<A as Aggregate>::Event: DeserializeOwned,
Load events by ids.
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, Global>> where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
Self: 'async_trait + Sync,
<A as Aggregate>::Event: DeserializeOwned,
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, Global>> where
'life0: 'async_trait,
A: Aggregate + 'async_trait,
Self: 'async_trait + Sync,
<A as Aggregate>::Event: DeserializeOwned,
Loads an aggregate by replaying all events.
Auto Trait Implementations
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
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more