pub struct SqliteOutboxPublisher { /* private fields */ }Expand description
SQLite implementation of OutboxPublisher backed by sqlx::SqlitePool.
Cheap to clone (the pool and the cached insert statement are reference-counted).
Implementations§
Source§impl SqliteOutboxPublisher
impl SqliteOutboxPublisher
Sourcepub fn new(
pool: SqlitePool,
table_name: impl Into<String>,
) -> Result<Self, OutboxError>
pub fn new( pool: SqlitePool, table_name: impl Into<String>, ) -> Result<Self, OutboxError>
Create a new publisher for the given pool and table.
§Errors
Returns OutboxError::Internal if table_name is not a valid
identifier matching ^[a-zA-Z_][a-zA-Z0-9_]*$.
Sourcepub fn pool(&self) -> &SqlitePool
pub fn pool(&self) -> &SqlitePool
Underlying pool, exposed for callers that open their own transactions.
Sourcepub fn table_name(&self) -> &str
pub fn table_name(&self) -> &str
Configured table name.
Trait Implementations§
Source§impl Clone for SqliteOutboxPublisher
impl Clone for SqliteOutboxPublisher
Source§fn clone(&self) -> SqliteOutboxPublisher
fn clone(&self) -> SqliteOutboxPublisher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SqliteOutboxPublisher
impl Debug for SqliteOutboxPublisher
Source§impl OutboxPublisher for SqliteOutboxPublisher
impl OutboxPublisher for SqliteOutboxPublisher
Source§type Tx<'tx> = Transaction<'tx, Sqlite>
type Tx<'tx> = Transaction<'tx, Sqlite>
Backend-specific transaction handle borrowed by
publish_in_tx. Read moreSource§async fn publish_in_tx<E: Event>(
&self,
tx: &mut Self::Tx<'_>,
event: &E,
) -> Result<Uuid, OutboxError>
async fn publish_in_tx<E: Event>( &self, tx: &mut Self::Tx<'_>, event: &E, ) -> Result<Uuid, OutboxError>
Insert an event using an existing business transaction. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteOutboxPublisher
impl !UnwindSafe for SqliteOutboxPublisher
impl Freeze for SqliteOutboxPublisher
impl Send for SqliteOutboxPublisher
impl Sync for SqliteOutboxPublisher
impl Unpin for SqliteOutboxPublisher
impl UnsafeUnpin for SqliteOutboxPublisher
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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