Struct Mailstrom

Source
pub struct Mailstrom<S: MailstromStorage + 'static> { /* private fields */ }

Implementations§

Source§

impl<S: MailstromStorage + 'static> Mailstrom<S>

Source

pub fn new(config: Config, storage: S) -> Mailstrom<S>

Create a new Mailstrom instance for sending emails.

Source

pub fn start(&mut self) -> Result<(), Error>

Mailstrom requires an explicit start command to start sending emails. This is because some clients are only interested in reading the status of sent emails, and will terminate before any real sending can be accomplished.

Source

pub fn die(&mut self) -> Result<(), Error>

Ask Mailstrom to die. This is not required, you can simply let it fall out of scope and it will clean itself up.

Source

pub fn worker_status(&self) -> WorkerStatus

Determine the status of the worker

Source

pub fn send_email(&mut self, email: Email) -> Result<String, Error>

Send an email, getting back its message-id

Source

pub fn query_status(&mut self, message_id: &str) -> Result<MessageStatus, Error>

Source

pub fn query_recent(&mut self) -> Result<Vec<MessageStatus>, Error>

Trait Implementations§

Source§

impl<S: MailstromStorage + 'static> Drop for Mailstrom<S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<S> Freeze for Mailstrom<S>

§

impl<S> RefUnwindSafe for Mailstrom<S>

§

impl<S> Send for Mailstrom<S>

§

impl<S> Sync for Mailstrom<S>

§

impl<S> Unpin for Mailstrom<S>

§

impl<S> UnwindSafe for Mailstrom<S>

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> TryFrom<T> for T

Source§

type Error = ParseError

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

fn try_from(input: T) -> Result<T, <T as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.