pub struct MySqlOutboxPublisher { /* private fields */ }Expand description
MySQL implementation of OutboxPublisher backed by sqlx::MySqlPool.
Cheap to clone (the pool and the cached insert statement are reference-counted).
Implementations§
Source§impl MySqlOutboxPublisher
impl MySqlOutboxPublisher
Sourcepub fn new(
pool: MySqlPool,
table_name: impl Into<String>,
) -> Result<Self, OutboxError>
pub fn new( pool: MySqlPool, 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) -> &MySqlPool
pub fn pool(&self) -> &MySqlPool
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 MySqlOutboxPublisher
impl Clone for MySqlOutboxPublisher
Source§fn clone(&self) -> MySqlOutboxPublisher
fn clone(&self) -> MySqlOutboxPublisher
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 MySqlOutboxPublisher
impl Debug for MySqlOutboxPublisher
Source§impl OutboxPublisher for MySqlOutboxPublisher
impl OutboxPublisher for MySqlOutboxPublisher
Source§type Tx<'tx> = Transaction<'tx, MySql>
type Tx<'tx> = Transaction<'tx, MySql>
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 MySqlOutboxPublisher
impl !UnwindSafe for MySqlOutboxPublisher
impl Freeze for MySqlOutboxPublisher
impl Send for MySqlOutboxPublisher
impl Sync for MySqlOutboxPublisher
impl Unpin for MySqlOutboxPublisher
impl UnsafeUnpin for MySqlOutboxPublisher
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