Skip to main content

MailEvent

Enum MailEvent 

Source
#[non_exhaustive]
pub enum MailEvent { Delivered { message_id: String, recipient: String, }, Deferred { message_id: String, recipient: String, attempt: u32, }, Bounced { message_id: String, recipient: String, code: u16, reason: String, }, Received { message_id: String, from: String, mailbox: String, }, }
Expand description

A lifecycle event emitted by the engine.

Marked #[non_exhaustive]: new variants will appear as the engine grows, and consumers must keep a catch-all arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Delivered

An outbound message was accepted by the remote server (250 to our DATA). Responsibility has transferred.

Fields

§message_id: String

Engine-assigned identifier of the message.

§recipient: String

The recipient this delivery was for.

§

Deferred

The remote server said “not now” (4xx). The message stays queued and will be retried with backoff — this is normal email behavior, not an error (greylisting relies on it).

Fields

§message_id: String

Engine-assigned identifier of the message.

§recipient: String

The recipient whose delivery was deferred.

§attempt: u32

Which delivery attempt this was (1-based).

§

Bounced

The remote server said “no, permanently” (5xx), or the queue lifetime expired. A bounce is generated toward the envelope MAIL FROM.

Fields

§message_id: String

Engine-assigned identifier of the message.

§recipient: String

The recipient that could not be reached.

§code: u16

The SMTP status code that ended the attempt.

§reason: String

The remote server’s human-readable reason line.

§

Received

An inbound message was accepted and stored.

Fields

§message_id: String

Engine-assigned identifier of the message.

§from: String

The envelope sender it arrived with.

§mailbox: String

The local mailbox it was delivered to.

Trait Implementations§

Source§

impl Clone for MailEvent

Source§

fn clone(&self) -> MailEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MailEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.