[][src]Struct mail_core::Metadata

pub struct Metadata {
    pub file_meta: FileMeta,
    pub media_type: MediaType,
    pub content_id: ContentId,
}

POD type containing FileMeta, Content-Type and Content-Id

The file meta contains optional information like file name and read as well as last modification data.

The media type will be used for the content type header which is used to determine how a mail client will handle the file. It is also used to get a hint on how to best transfer encode the file.

The content id is used to identify the "data" and refer to it from some other place. For example in a mail the html body could refer to a image contained in the mail to embed it in the mail.

As Content-Id's are supposed to be world unique they could also be used for some caching and similar but that plays hardly any role any more, except maybe for "external" mail bodies.

Fields

file_meta: FileMeta

File meta like file name or file read time.

media_type: MediaType

The media type of the data.

content_id: ContentId

The content id associated with the data.

Methods from Deref<Target = FileMeta>

pub fn replace_empty_fields_with(&mut self, other_meta: &FileMeta)[src]

Replaces all fields which are None with the value of the field in other_meta.

Trait Implementations

impl Clone for Metadata[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl DerefMut for Metadata[src]

impl Deref for Metadata[src]

type Target = FileMeta

The resulting type after dereferencing.

impl Debug for Metadata[src]

impl Serialize for Metadata[src]

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

Auto Trait Implementations

impl Send for Metadata

impl Sync for Metadata

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

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

impl<F, T> HeaderTryInto for F where
    T: HeaderTryFrom<F>, 
[src]

impl<T> HeaderTryFrom for T[src]

impl<T> Erased for T