Skip to main content

NotificationChannel

Trait NotificationChannel 

Source
pub trait NotificationChannel: Send + Sync {
    // Required methods
    fn kind(&self) -> &'static str;
    fn label(&self) -> &'static str;
    fn config_fields(&self) -> Vec<ConfigField>;
    fn deliver<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        d: &'life1 Delivery<'life2>,
        msg: &'life3 Notification,
    ) -> Pin<Box<dyn Future<Output = Result<(), DeliverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided method
    fn help(&self) -> &'static str { ... }
}
Expand description

A destination kind. Implement it, register it, and it appears in the admin’s channel picker with its own settings.

Required Methods§

Source

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

Stable key stored on the target row ("slack"). Changing it orphans existing targets, so treat it as data, not a label.

Source

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

Human name for the picker.

Source

fn config_fields(&self) -> Vec<ConfigField>

Source

fn deliver<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, d: &'life1 Delivery<'life2>, msg: &'life3 Notification, ) -> Pin<Box<dyn Future<Output = Result<(), DeliverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provided Methods§

Source

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

One line describing what the admin has to go and fetch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§