Struct eventsourced_postgres::PostgresEvtLog
source · pub struct PostgresEvtLog { /* private fields */ }
Expand description
An EvtLog implementation based on PostgreSQL.
Implementations§
Trait Implementations§
source§impl Clone for PostgresEvtLog
impl Clone for PostgresEvtLog
source§fn clone(&self) -> PostgresEvtLog
fn clone(&self) -> PostgresEvtLog
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 Debug for PostgresEvtLog
impl Debug for PostgresEvtLog
source§impl EvtLog for PostgresEvtLog
impl EvtLog for PostgresEvtLog
source§const MAX_SEQ_NO: SeqNo = _
const MAX_SEQ_NO: SeqNo = _
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 Error = Error
source§async fn persist<E, ToBytes, ToBytesError>(
&mut self,
evt: &E,
tag: Option<&str>,
type_name: &str,
id: Uuid,
last_seq_no: Option<SeqNo>,
to_bytes: &ToBytes
) -> Result<SeqNo, Self::Error>
async fn persist<E, ToBytes, ToBytesError>( &mut self, evt: &E, tag: Option<&str>, type_name: &str, id: Uuid, last_seq_no: Option<SeqNo>, to_bytes: &ToBytes ) -> Result<SeqNo, Self::Error>
Persist the given event and optional tag for the given entity type and 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(
&self,
_type: &str,
id: Uuid
) -> Result<Option<SeqNo>, Self::Error>
async fn last_seq_no( &self, _type: &str, id: Uuid ) -> Result<Option<SeqNo>, Self::Error>
Get the last sequence number for the given entity type and ID.
source§async fn evts_by_id<E, FromBytes, FromBytesError>(
&self,
_type: &str,
id: Uuid,
from_seq_no: SeqNo,
from_bytes: FromBytes
) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send, Self::Error>
async fn evts_by_id<E, FromBytes, FromBytesError>( &self, _type: &str, id: Uuid, from_seq_no: SeqNo, from_bytes: FromBytes ) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send, Self::Error>
Get the events for the given entity ID starting with the given sequence number.
source§async fn evts_by_type<E, FromBytes, FromBytesError>(
&self,
type_name: &str,
from_seq_no: SeqNo,
from_bytes: FromBytes
) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send, Self::Error>
async fn evts_by_type<E, FromBytes, FromBytesError>( &self, type_name: &str, from_seq_no: SeqNo, from_bytes: FromBytes ) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send, Self::Error>
Get the events for the given entity type starting with the given sequence number.
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresEvtLog
impl Send for PostgresEvtLog
impl Sync for PostgresEvtLog
impl Unpin for PostgresEvtLog
impl !UnwindSafe for PostgresEvtLog
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