[][src]Trait samotop_core::service::mail::MailSetup

pub trait MailSetup<NS, ES, GS, QS> {
    type Output: MailService + Send + Sync;
    fn setup(self, named: NS, extend: ES, guard: GS, queue: QS) -> Self::Output;
}

Can set up the given mail services.

/// This mail service has a very special name
#[derive(Clone, Debug)]
struct MyMail;

impl<NS, ES, GS, QS> MailSetup<NS, ES, GS, QS> for MyMail
where
    NS: NamedService,
    ES: EsmtpService,
    GS: MailGuard,
    QS: MailQueue,
{
    type Output = composite::CompositeMailService<&'static str, ES, GS, QS>;
    fn setup(self, _named: NS, extend: ES, guard: GS, queue: QS) -> Self::Output {
        ("my.name.example.com", extend, guard, queue)
    }
}

let mail_svc = default::DefaultMailService.using(MyMail);

Associated Types

Loading content...

Required methods

fn setup(self, named: NS, extend: ES, guard: GS, queue: QS) -> Self::Output

Loading content...

Implementors

impl<T, NS, ES, GS, QS> MailSetup<NS, ES, GS, QS> for T where
    T: NamedService,
    NS: NamedService,
    ES: EsmtpService,
    GS: MailGuard,
    QS: MailQueue
[src]

type Output = CompositeMailService<T, ES, GS, QS>

Loading content...