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<'a, E, EvtToBytes, EvtToBytesError>(
&'a mut self,
id: Uuid,
evt: &'a E,
tag: Option<String>,
evt_to_bytes: &'a EvtToBytes
) -> Result<SeqNo, Self::Error>where
E: Debug + Send + Sync + 'a,
EvtToBytes: Fn(&E) -> Result<Bytes, EvtToBytesError> + Send + Sync,
EvtToBytesError: StdError + Send + Sync + 'static,
async fn persist<'a, E, EvtToBytes, EvtToBytesError>(
&'a mut self,
id: Uuid,
evt: &'a E,
tag: Option<String>,
evt_to_bytes: &'a EvtToBytes
) -> Result<SeqNo, Self::Error>where
E: Debug + Send + Sync + 'a,
EvtToBytes: Fn(&E) -> Result<Bytes, EvtToBytesError> + Send + Sync,
EvtToBytesError: StdError + Send + Sync + 'static,
Persist the given event and optional tag for the given entity ID and returns the sequence
number for the persisted event.
source§async fn last_seq_no(&self, id: Uuid) -> Result<Option<SeqNo>, Self::Error>
async fn last_seq_no(&self, id: Uuid) -> Result<Option<SeqNo>, Self::Error>
Get the last sequence number for the given entity ID.
source§async fn evts_by_id<'a, E, EvtFromBytes, EvtFromBytesError>(
&'a self,
id: Uuid,
from_seq_no: SeqNo,
evt_from_bytes: EvtFromBytes
) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send + '_, Self::Error>where
E: Debug + Send + 'a,
EvtFromBytes: Fn(Bytes) -> Result<E, EvtFromBytesError> + Copy + Send + Sync + 'static,
EvtFromBytesError: StdError + Send + Sync + 'static,
async fn evts_by_id<'a, E, EvtFromBytes, EvtFromBytesError>(
&'a self,
id: Uuid,
from_seq_no: SeqNo,
evt_from_bytes: EvtFromBytes
) -> Result<impl Stream<Item = Result<(SeqNo, E), Self::Error>> + Send + '_, Self::Error>where
E: Debug + Send + 'a,
EvtFromBytes: Fn(Bytes) -> Result<E, EvtFromBytesError> + Copy + Send + Sync + 'static,
EvtFromBytesError: StdError + Send + Sync + 'static,
Get the events for the given entity ID in the given closed range of sequence numbers.