pub enum MailerMode {
SendOk,
NotConfigured,
Fail,
Error(MailError),
}Expand description
How a FakeMailer answers.
Error is what makes the failure arms testable at all
(issue #236): before it the fake could only ever produce
MailError::Upstream("fake mailer failure"), so Invalid { detail }
and DomainNotVerified { domain } — the two variants that carry the
provider’s own text, and therefore the two that can carry a recipient
address — could not be driven from a test. Every arm of a caller’s
outcome mapping is now reachable, with the text the caller chooses:
let mailer = FakeMailer::new(MailerMode::Error(MailError::Invalid {
detail: "to: alice@example.test is suppressed".to_owned(),
}));Variants§
SendOk
Accept and record the message.
NotConfigured
Report that the adapter has no API key or no verified domain.
Fail
A generic upstream failure, for a caller that does not care which.
Error(MailError)
Exactly this error, text and all.
Trait Implementations§
Source§impl Clone for MailerMode
impl Clone for MailerMode
Source§impl Debug for MailerMode
impl Debug for MailerMode
impl Eq for MailerMode
Source§impl PartialEq for MailerMode
impl PartialEq for MailerMode
impl StructuralPartialEq for MailerMode
Auto Trait Implementations§
impl Freeze for MailerMode
impl RefUnwindSafe for MailerMode
impl Send for MailerMode
impl Sync for MailerMode
impl Unpin for MailerMode
impl UnsafeUnpin for MailerMode
impl UnwindSafe for MailerMode
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.