pub struct TxOutbox;Expand description
Zero-sized handle for the transactional outbox write.
Implementations§
Source§impl TxOutbox
impl TxOutbox
Sourcepub async fn persist_with(
&self,
tx: &mut Transaction<'_, Any>,
event: EventRow,
outbox: OutboxRow,
) -> Result<(), OutboxError>
pub async fn persist_with( &self, tx: &mut Transaction<'_, Any>, event: EventRow, outbox: OutboxRow, ) -> Result<(), OutboxError>
Enqueue both the event INSERT and the outbox INSERT on tx.
Both statements execute against the same transaction, so the caller’s
subsequent tx.commit() makes both durable atomically, and dropping /
rolling back tx discards both. This method does not commit.
The target tables are assumed to exist (the SQL provider’s
event_journal plus an outbox(topic, payload, created_at) table the
application provisions); see the crate tests for the reference DDL.
Auto Trait Implementations§
impl Freeze for TxOutbox
impl RefUnwindSafe for TxOutbox
impl Send for TxOutbox
impl Sync for TxOutbox
impl Unpin for TxOutbox
impl UnsafeUnpin for TxOutbox
impl UnwindSafe for TxOutbox
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