[−][src]Struct mail::compose::BodyPart
Parts used to create a mail body (in a multipart mail).
This type contains a Resource
which is normally used
to create a alternative body in a multipart/alternative
section. As well as a number of "embeddings" which depending
on there disposition can are either used as attachments
or embedded resource to which the body can referre to
by it's content id.
Fields
resource: Resource
A body created by a template.
inline_embeddings: Vec<Resource>
A number of embeddings which should be displayed inline.
This is normally used to embed images then displayed in
a html body. It is not in the scope of this part of the
library to bind content id's to resources to thinks using
them to display the embeddings. This part of the library
does "just" handle that they are correctly placed in the
resulting Mail. The mail-templates
crate provides more
functionality for better ergonomics.
Note that embeddings placed in a BodyPart
instance are potentially
only usable in the body specified in the same BodyPart
instance.
attachments: Vec<Resource>
A number of embeddings which should be treated as attachments.
Attachments of a BodyPart
instance will be combined with
the attachments of other instances and the ones in the
MailParts
instance.
Methods
impl BodyPart
[src]
pub fn create_mail(self, attachments_out: &mut Vec<Mail>) -> Mail
[src]
Creates a Mail
instance from this BodyPart
instance.
All embeddings in BodyPart.embeddings
which have a
attachment content disposition are placed into the
attachments_out
parameter, as attachments should
always be handled on the outer most level but the
produced mail is likely not the outer most level.
This will create a non-multipart body for the
body Resource
, if there are any embeddings which
have a Inline
disposition that body will be
wrapped into a multipart/related
body containing
them.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<F, T> HeaderTryInto for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,