[][src]Enum trapmail::MailBody

pub enum MailBody {
    Utf8(String),
    Invalid(Vec<u8>),
}

An email body.

Mail bodies should be 7-bit ASCII (which is a subset of UTF-8), but there is no guarantee that clients/callers send valid data.

Upon creation, the body is parsed and stored as one of either variant, this allows the JSON serialization to be ideally human-readable, if valid UTF8 is used (i.e. one can have a quick look at mail contents in a text editor).

Variants

Utf8(String)

A valid UTF8-formatted mail.

Invalid(Vec<u8>)

A mail containing non-UTF8 characters.

Trait Implementations

impl Debug for MailBody[src]

impl<'de> Deserialize<'de> for MailBody[src]

impl Display for MailBody[src]

impl Serialize for MailBody[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.