pub struct PostgresEventStore { /* private fields */ }Expand description
PostgreSQL-backed event store with optimistic concurrency.
Implementations§
Trait Implementations§
Source§impl EventStore for PostgresEventStore
impl EventStore for PostgresEventStore
Source§fn load_events<'life0, 'async_trait>(
&'life0 self,
aggregate_id: Uuid,
from_version: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_events<'life0, 'async_trait>(
&'life0 self,
aggregate_id: Uuid,
from_version: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load events for an aggregate starting after
from_version.
Pass 0 to load all events.Source§fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: Uuid,
aggregate_type: &'life1 str,
expected_version: u64,
events: Vec<NewEvent>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregate_id: Uuid,
aggregate_type: &'life1 str,
expected_version: u64,
events: Vec<NewEvent>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append events with optimistic concurrency check.
Returns the new version (sequence of the last appended event).
Auto Trait Implementations§
impl Freeze for PostgresEventStore
impl !RefUnwindSafe for PostgresEventStore
impl Send for PostgresEventStore
impl Sync for PostgresEventStore
impl Unpin for PostgresEventStore
impl UnsafeUnpin for PostgresEventStore
impl !UnwindSafe for PostgresEventStore
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> EventStoreExt for Twhere
T: EventStore,
impl<T> EventStoreExt for Twhere
T: EventStore,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more