openzeppelin_monitor::services::notification

Trait Notifier

Source
pub trait Notifier {
    // Required method
    fn notify<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn notify_with_payload<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 str,
        _payload_fields: HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Interface for notification implementations

All notification types must implement this trait to provide consistent notification behavior.

Required Methods§

Source

fn notify<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a notification with the given message

§Arguments
  • message - The formatted message to send
§Returns
  • Result<(), anyhow::Error> - Success or error

Provided Methods§

Source

fn notify_with_payload<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 str, _payload_fields: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a notification with custom payload fields

§Arguments
  • message - The formatted message to send
  • payload_fields - Additional fields to include in the payload
§Returns
  • Result<(), anyhow::Error> - Success or error

Implementors§