pub trait OutboxSender: Send + Sync {
// Required method
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
entry: &'life1 OutboxEntry,
) -> Pin<Box<dyn Future<Output = Dispatched> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Calls the external system for one outbox row.
The implementation owns the transport and the credentials; this module owns the bookkeeping. Two obligations are the application’s:
- forward
OutboxEntry::idempotency_keyto the remote, in whatever header or field it deduplicates on. It is the same key the command was admitted under, so a row dispatched twice after a crash is one effect; - classify honestly. A transport error after the bytes were written is
Dispatched::Unknown, notDispatched::Retryable. If you cannot tell the two apart, it isUnknown.
Required Methods§
Sourcefn send<'life0, 'life1, 'async_trait>(
&'life0 self,
entry: &'life1 OutboxEntry,
) -> Pin<Box<dyn Future<Output = Dispatched> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
entry: &'life1 OutboxEntry,
) -> Pin<Box<dyn Future<Output = Dispatched> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sends one row.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".