Struct mail::Metadata

source ·
pub struct Metadata {
    pub file_meta: FileMeta,
    pub media_type: MediaType,
    pub content_id: MessageId,
}
Expand description

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: MessageId

The content id associated with the data.

Methods from Deref<Target = FileMeta>

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

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.