pub trait NotificationProvider: Send + Sync {
// Required methods
fn send_email<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
to: &'life1 str,
subject: &'life2 str,
body: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn send_chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
An abstraction for any Notification delivery service (SendGrid, Slack, Twilio, etc.)
Required Methods§
Sourcefn send_email<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
to: &'life1 str,
subject: &'life2 str,
body: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn send_email<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
to: &'life1 str,
subject: &'life2 str,
body: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Send an email
Sourcefn send_chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a Chat Message (Slack/Teams/Discord)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".