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
type Error = Error
source§async fn persist<'a, 'b, 'c, E, EvtToBytes, EvtToBytesError>(
&'a self,
id: Uuid,
evts: &'b [E],
last_seq_no: u64,
evt_to_bytes: &'c EvtToBytes
) -> Result<Metadata, Self::Error>where
E: Send + Sync + 'a,
EvtToBytes: Fn(&E) -> Result<Bytes, EvtToBytesError> + Send + Sync,
EvtToBytesError: StdError + Send + Sync + 'static,
'b: 'a,
'c: 'a,
async fn persist<'a, 'b, 'c, E, EvtToBytes, EvtToBytesError>(
&'a self,
id: Uuid,
evts: &'b [E],
last_seq_no: u64,
evt_to_bytes: &'c EvtToBytes
) -> Result<Metadata, Self::Error>where
E: Send + Sync + 'a,
EvtToBytes: Fn(&E) -> Result<Bytes, EvtToBytesError> + Send + Sync,
EvtToBytesError: StdError + Send + Sync + 'static,
'b: 'a,
'c: 'a,
Persist the given events for the given entity ID and the given last sequence number.
source§async fn last_seq_no(&self, id: Uuid) -> Result<u64, Self::Error>
async fn last_seq_no(&self, id: Uuid) -> Result<u64, 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: u64,
to_seq_no: u64,
_metadata: Metadata,
evt_from_bytes: EvtFromBytes
) -> Result<impl Stream<Item = Result<(u64, E), Self::Error>> + Send + '_, Self::Error>where
E: 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: u64,
to_seq_no: u64,
_metadata: Metadata,
evt_from_bytes: EvtFromBytes
) -> Result<impl Stream<Item = Result<(u64, E), Self::Error>> + Send + '_, Self::Error>where
E: Send + 'a,
EvtFromBytes: Fn(Bytes) -> Result<E, EvtFromBytesError> + Copy + Send + Sync + 'static,
EvtFromBytesError: StdError + Send + Sync + 'static,
Get the events for the given ID in the given closed range of sequence numbers.