Skip to main content

Fake

Struct Fake 

Source
pub struct Fake { /* private fields */ }
Expand description

A transport that records instead of sending.

Implementations§

Source§

impl Fake

Source

pub fn new() -> Fake

Source

pub fn sent(&self) -> Vec<Message>

Every message that would have been sent, in order.

Source

pub fn sent_to(&self, address: &str) -> Vec<Message>

The messages addressed to one recipient — To, Cc or Bcc.

Source

pub fn count(&self) -> usize

Source

pub fn clear(&self)

Forget everything recorded so far.

Source

pub fn assert_sent_to(&self, address: &str)

Source

pub fn assert_not_sent_to(&self, address: &str)

Source

pub fn assert_sent_times(&self, expected: usize)

Source

pub fn assert_nothing_sent(&self)

Trait Implementations§

Source§

impl Default for Fake

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Transport for Fake

Source§

fn name(&self) -> &'static str

The transport’s name, as it appears in the mail.sent event.
Source§

fn send<'a>(&'a self, message: &'a Message) -> BoxFuture<'a, Result<()>>

Auto Trait Implementations§

§

impl !Freeze for Fake

§

impl RefUnwindSafe for Fake

§

impl Send for Fake

§

impl Sync for Fake

§

impl Unpin for Fake

§

impl UnsafeUnpin for Fake

§

impl UnwindSafe for Fake

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.