Struct eventsourced_postgres::PostgresEvtLog
source · pub struct PostgresEvtLog<I> { /* private fields */ }
Expand description
An EvtLog implementation based on PostgreSQL.
Implementations§
Trait Implementations§
source§impl<I: Clone> Clone for PostgresEvtLog<I>
impl<I: Clone> Clone for PostgresEvtLog<I>
source§fn clone(&self) -> PostgresEvtLog<I>
fn clone(&self) -> PostgresEvtLog<I>
Returns a copy 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<I> Debug for PostgresEvtLog<I>
impl<I> Debug for PostgresEvtLog<I>
source§impl<I> EvtLog for PostgresEvtLog<I>
impl<I> EvtLog for PostgresEvtLog<I>
source§const MAX_SEQ_NO: NonZeroU64 = _
const MAX_SEQ_NO: NonZeroU64 = _
The maximum value for sequence numbers. As PostgreSQL does not support unsigned integers,
this is i64::MAX
or 9_223_372_036_854_775_807
.
type Id = I
type Error = Error
source§async fn persist<E, ToBytes, ToBytesError>(
&mut self,
evt: &E::Evt,
id: &Self::Id,
last_seq_no: Option<NonZeroU64>,
to_bytes: &ToBytes
) -> Result<NonZeroU64, Self::Error>
async fn persist<E, ToBytes, ToBytesError>( &mut self, evt: &E::Evt, id: &Self::Id, last_seq_no: Option<NonZeroU64>, to_bytes: &ToBytes ) -> Result<NonZeroU64, Self::Error>
Persist the given event and optional tag for the given entity ID and return the
sequence number for the persisted event. The given last sequence number is used for
optimistic locking, i.e. it must match the current last sequence number of the event log.
source§async fn last_seq_no<E>(
&self,
id: &Self::Id
) -> Result<Option<NonZeroU64>, Self::Error>where
E: EventSourced,
async fn last_seq_no<E>(
&self,
id: &Self::Id
) -> Result<Option<NonZeroU64>, Self::Error>where
E: EventSourced,
Get the last sequence number for the given entity ID.
source§async fn evts_by_id<E, FromBytes, FromBytesError>(
&self,
id: &Self::Id,
seq_no: NonZeroU64,
from_bytes: FromBytes
) -> Result<impl Stream<Item = Result<(NonZeroU64, E::Evt), Self::Error>> + Send, Self::Error>
async fn evts_by_id<E, FromBytes, FromBytesError>( &self, id: &Self::Id, seq_no: NonZeroU64, from_bytes: FromBytes ) -> Result<impl Stream<Item = Result<(NonZeroU64, E::Evt), Self::Error>> + Send, Self::Error>
Get the events for the given entity ID starting at the given sequence number.
source§async fn evts_by_type<E, FromBytes, FromBytesError>(
&self,
seq_no: NonZeroU64,
from_bytes: FromBytes
) -> Result<impl Stream<Item = Result<(NonZeroU64, E::Evt), Self::Error>> + Send, Self::Error>
async fn evts_by_type<E, FromBytes, FromBytesError>( &self, seq_no: NonZeroU64, from_bytes: FromBytes ) -> Result<impl Stream<Item = Result<(NonZeroU64, E::Evt), Self::Error>> + Send, Self::Error>
Get the events for the given entity type starting at the given sequence number.
Auto Trait Implementations§
impl<I> !RefUnwindSafe for PostgresEvtLog<I>
impl<I> Send for PostgresEvtLog<I>where
I: Send,
impl<I> Sync for PostgresEvtLog<I>where
I: Sync,
impl<I> Unpin for PostgresEvtLog<I>where
I: Unpin,
impl<I> !UnwindSafe for PostgresEvtLog<I>
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