Trait lettre::message::IntoBody

source ·
pub trait IntoBody {
    // Required method
    fn into_body(self, encoding: Option<ContentTransferEncoding>) -> Body;
}
Available on crate feature builder only.
Expand description

A trait for something that takes an encoded Body.

Used by MessageBuilder::body and SinglePartBuilder::body, which can either take something that can be encoded into Body or a pre-encoded Body.

If encoding is None the best encoding between 7bit, quoted-printable and base64 is chosen based on the input body. Best option.

If encoding is Some the supplied encoding is used. NOTE: if using the specified encoding would result into a malformed body, this will panic!

Required Methods§

source

fn into_body(self, encoding: Option<ContentTransferEncoding>) -> Body

Encode as valid body

Implementors§

source§

impl IntoBody for Body

source§

impl<T> IntoBody for T
where T: Into<MaybeString>,