pub struct SqlJournal { /* private fields */ }Implementations§
Source§impl SqlJournal
impl SqlJournal
Sourcepub async fn connect(cfg: SqlConfig) -> Result<Arc<Self>, JournalError>
pub async fn connect(cfg: SqlConfig) -> Result<Arc<Self>, JournalError>
Connect, install drivers, and optionally run migrations.
Sourcepub async fn from_pool(
pool: AnyPool,
cfg: SqlConfig,
) -> Result<Arc<Self>, JournalError>
pub async fn from_pool( pool: AnyPool, cfg: SqlConfig, ) -> Result<Arc<Self>, JournalError>
Reuse an existing pool (for tests or app-wide sharing).
pub fn pool(&self) -> &AnyPool
pub fn config(&self) -> &SqlConfig
Trait Implementations§
Source§impl Journal for SqlJournal
impl Journal for SqlJournal
fn write_messages<'life0, 'async_trait>(
&'life0 self,
messages: Vec<PersistentRepr>,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_messages_to<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 str,
to_sequence_nr: u64,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn replay_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 str,
from: u64,
to: u64,
max: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistentRepr>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn highest_sequence_nr<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 str,
_from_sequence_nr: u64,
) -> Pin<Box<dyn Future<Output = Result<u64, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn events_by_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 str,
from_offset: u64,
max: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistentRepr>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn all_persistence_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, JournalError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn all_persistence_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, JournalError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Distinct persistence ids known to the backend. Default impl
returns empty so backends without an id index opt in.
Auto Trait Implementations§
impl Freeze for SqlJournal
impl !RefUnwindSafe for SqlJournal
impl Send for SqlJournal
impl Sync for SqlJournal
impl Unpin for SqlJournal
impl UnsafeUnpin for SqlJournal
impl !UnwindSafe for SqlJournal
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
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