Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signal: &'life1 Signal,
    ) -> Pin<Box<dyn Future<Output = Result<(), SignalError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn preview(&self, _signal: &Signal) -> Option<Value> { ... }
}
Expand description

Every provider (Slack, Webhook, Console, …) implements this. Adding a provider never requires touching routing or retry logic — that’s the abstraction boundary that keeps the core’s “don’t become an event bus” promise honest.

Required Methods§

Source

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

Source

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

Provided Methods§

Source

fn preview(&self, _signal: &Signal) -> Option<Value>

What send would deliver for signal, without sending it, for checking templates (signal preview). None when the provider can’t show it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§