pub trait Notification<Recipient> {
// Required methods
fn via(
&self,
recipient: &Recipient,
) -> Result<Vec<Channel>, NotificationError>;
fn to_mail(
&self,
recipient: &Recipient,
) -> Result<MailMessage, NotificationError>;
}Expand description
Application-owned notification content and channel selection.
Required Methods§
Sourcefn via(&self, recipient: &Recipient) -> Result<Vec<Channel>, NotificationError>
fn via(&self, recipient: &Recipient) -> Result<Vec<Channel>, NotificationError>
Select channels separately for each recipient.
Sourcefn to_mail(
&self,
recipient: &Recipient,
) -> Result<MailMessage, NotificationError>
fn to_mail( &self, recipient: &Recipient, ) -> Result<MailMessage, NotificationError>
Compose the application-rendered mail for this recipient.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".