Trait AppMailer

Source
pub trait AppMailer: AppTypes + Send {
    type MailError: Into<Self::Error>;

    // Required methods
    fn send_notification(
        &mut self,
        user: &Self::User,
        notification: Notification,
    ) -> impl Future<Output = Result<(), Self::MailError>> + Send;
    fn send_challenge(
        &mut self,
        user: &Self::User,
        challenge: Challenge<Self>,
        code: Secret,
    ) -> impl Future<Output = Result<(), Self::MailError>> + Send;
}
Expand description

This trait defines functions which will be used by the authentication library to send email notifications and challenges to users.

Required Associated Types§

Required Methods§

Source

fn send_notification( &mut self, user: &Self::User, notification: Notification, ) -> impl Future<Output = Result<(), Self::MailError>> + Send

Sends an email notification to the given user.

Source

fn send_challenge( &mut self, user: &Self::User, challenge: Challenge<Self>, code: Secret, ) -> impl Future<Output = Result<(), Self::MailError>> + Send

Sends an email message to the given user, with a link to complete a challenge. The link must match a route which invokes complete_challenge(code).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§