pub struct PostgresEventStore { /* private fields */ }Expand description
PostgreSQL-backed event store with per-namespace tables.
Implementations§
Trait Implementations§
Source§impl Clone for PostgresEventStore
impl Clone for PostgresEventStore
Source§fn clone(&self) -> PostgresEventStore
fn clone(&self) -> PostgresEventStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl EventStore for PostgresEventStore
impl EventStore for PostgresEventStore
Source§fn ensure_namespace<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_namespace<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Ensure storage exists for the namespace.
Source§fn persist_next<'life0, 'life1, 'life2, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
payload: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<StreamEvent>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn persist_next<'life0, 'life1, 'life2, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
payload: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<StreamEvent>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Allocate the next monotonic version and persist the event atomically.
Source§fn load_history<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_history<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load up to
limit most recent events in ascending version order.Source§fn load_after_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
after_version: EventVersion,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_after_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
after_version: EventVersion,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load events with version strictly greater than
after_version.Source§fn latest_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<Option<EventVersion>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn latest_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<Option<EventVersion>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Latest assigned version for the namespace, if any events exist.
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresEventStore
impl !UnwindSafe for PostgresEventStore
impl Freeze for PostgresEventStore
impl Send for PostgresEventStore
impl Sync for PostgresEventStore
impl Unpin for PostgresEventStore
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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