pub enum MimeTree {
Single(MimePart),
Alternative {
text: Option<MimePart>,
html: Box<MimeTree>,
},
Related {
root: Box<MimeTree>,
related: Vec<MimePart>,
},
Mixed {
body: Box<MimeTree>,
attachments: Vec<MimePart>,
},
}Expand description
Top-level Mime body layout for an Email.
This is the framework view of multipart structure. SMTP encoding still goes
through lettre when the smtp feature is enabled.
Variants§
Single(MimePart)
Single body part (text or HTML without nested multiparts).
Alternative
multipart/alternative: plain text plus an HTML (or related) sibling.
Fields
Related
multipart/related wrapping HTML plus inline CID parts.
Fields
Inline parts referenced via cid:.
Mixed
multipart/mixed with a primary body and downloadable attachments.
Implementations§
Source§impl MimeTree
impl MimeTree
Sourcepub fn from_email(email: &Email) -> MimeTree
pub fn from_email(email: &Email) -> MimeTree
Builds the Mime tree for an email (multipart rules used by SMTP encode).
Nesting matches common client expectations:
- text + HTML →
multipart/alternative - HTML + CID inline →
multipart/related(as the HTML alternative sibling when text exists) - downloadable files → outer
multipart/mixed
Sourcepub const fn multipart_subtype(&self) -> Option<&'static str>
pub const fn multipart_subtype(&self) -> Option<&'static str>
Multipart subtype at this node (alternative, related, mixed), if any.
Trait Implementations§
impl Eq for MimeTree
impl StructuralPartialEq for MimeTree
Auto Trait Implementations§
impl Forget for MimeTree
impl Freeze for MimeTree
impl Move for MimeTree
impl RefUnwindSafe for MimeTree
impl Send for MimeTree
impl Sync for MimeTree
impl Unpin for MimeTree
impl UnsafeUnpin for MimeTree
impl UnwindSafe for MimeTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.