pub enum MailDriver {
Log,
File,
Memory,
Smtp,
}Expand description
Which Transport to build.
use rainier_mail::MailDriver;
use rainier_support::Setting;
assert!(!MailDriver::Log.delivers(), "nothing leaves the machine");
assert!(MailDriver::parse("smtp").unwrap().delivers());Variants§
Log
Write the message to the log and deliver nothing.
The default, and the only safe one to have by accident: a misconfigured production deployment fails to send mail rather than sending it to real people from a staging database.
File
Write each message to a .eml file under storage/mail.
Openable in a mail client, so you can check what a template actually renders to. Delivers nothing.
Memory
Keep messages in memory so a test can assert on them.
Never right outside a test — the messages go nowhere and the vector grows until the process ends.
Smtp
A real SMTP server.
Implementations§
Source§impl MailDriver
impl MailDriver
Source§impl MailDriver
impl MailDriver
Sourcepub fn delivers(&self) -> bool
pub fn delivers(&self) -> bool
Whether a message actually leaves the machine.
The check worth making before a seeder or a backfill: everything else here is safe to point a hundred thousand messages at.
Sourcepub fn is_inspectable(&self) -> bool
pub fn is_inspectable(&self) -> bool
Whether the sent messages can be read back and asserted on.
Trait Implementations§
Source§impl AsRef<str> for MailDriver
impl AsRef<str> for MailDriver
Source§impl Clone for MailDriver
impl Clone for MailDriver
Source§fn clone(&self) -> MailDriver
fn clone(&self) -> MailDriver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MailDriver
Source§impl Debug for MailDriver
impl Debug for MailDriver
Source§impl Default for MailDriver
impl Default for MailDriver
Source§fn default() -> MailDriver
fn default() -> MailDriver
Source§impl<'de> Deserialize<'de> for MailDriver
impl<'de> Deserialize<'de> for MailDriver
Source§fn deserialize<D>(
deserializer: D,
) -> Result<MailDriver, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MailDriver, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for MailDriver
impl Display for MailDriver
impl Eq for MailDriver
Source§impl FromStr for MailDriver
impl FromStr for MailDriver
Source§impl Hash for MailDriver
impl Hash for MailDriver
Source§impl PartialEq for MailDriver
impl PartialEq for MailDriver
Source§impl Serialize for MailDriver
impl Serialize for MailDriver
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl Setting for MailDriver
impl Setting for MailDriver
Source§const SETTING: &'static str = "mail driver"
const SETTING: &'static str = "mail driver"
"cache driver". Read moreSource§const ALL: &'static [MailDriver]
const ALL: &'static [MailDriver]
impl StructuralPartialEq for MailDriver
Auto Trait Implementations§
impl Freeze for MailDriver
impl RefUnwindSafe for MailDriver
impl Send for MailDriver
impl Sync for MailDriver
impl Unpin for MailDriver
impl UnsafeUnpin for MailDriver
impl UnwindSafe for MailDriver
Blanket Implementations§
impl<T> Actor for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more