Skip to main content

NotifyBackend

Trait NotifyBackend 

Source
pub trait NotifyBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 NotifyEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), NotifyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A pluggable notification channel.

Required Methods§

Source

fn name(&self) -> &'static str

The configuration name this backend runs under, used in logs.

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 NotifyEvent, ) -> Pin<Box<dyn Future<Output = Result<(), NotifyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delivers event. Failure is always non-fatal to the caller — see the module docs — but it is no longer thrown away: NotifyJob retries it unless the NotifyError says the attempt could never have worked.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§