openzeppelin_monitor::services::notification

Trait ScriptExecutor

Source
pub trait ScriptExecutor {
    // Required method
    fn script_notify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        monitor_match: &'life1 MonitorMatch,
        script_content: &'life2 (ScriptLanguage, String),
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Interface for executing scripts

This Interface is used to execute scripts for notifications. It is implemented by the ScriptNotifier struct.

Required Methods§

Source

fn script_notify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, monitor_match: &'life1 MonitorMatch, script_content: &'life2 (ScriptLanguage, String), ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a script to send a custom notifications

§Arguments
  • monitor_match - The monitor match to send
  • script_content - The script content to execute
§Returns
  • Result<(), anyhow::Error> - Success or error

Implementors§