pub trait NotificationDelivery: Send + Sync {
// Required method
fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
notification: &'life1 PendingNotification,
) -> Pin<Box<dyn Future<Output = DeliveryOutcome> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn consumer(&self) -> &str { ... }
}Expand description
What a notification module implements: perform one request.
The dispatcher calls it with the request claimed and a database transaction open (see the module guarantees), so keep it to the provider call: it holds a pool connection until it answers. It must not stage rows on the dispatcher’s behalf; to record that something was sent it writes through its own service, inside the correlation the dispatcher bound.
Required Methods§
Sourcefn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
notification: &'life1 PendingNotification,
) -> Pin<Box<dyn Future<Output = DeliveryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn deliver<'life0, 'life1, 'async_trait>(
&'life0 self,
notification: &'life1 PendingNotification,
) -> Pin<Box<dyn Future<Output = DeliveryOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform notification.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".