pub struct FileMeta {
    pub file_name: Option<String>,
    pub creation_date: Option<DateTime<Utc>>,
    pub modification_date: Option<DateTime<Utc>>,
    pub read_date: Option<DateTime<Utc>>,
    pub size: Option<usize>,
}
Expand description

A struct representing common file metadata.

This is used by e.g. attachments, when attaching a file (or embedding an image). Through it’s usage is optional.

Stability Note

This is likely to move to an different place at some point, potentially in a different mail-* crate.

Fields§

§file_name: Option<String>

The file name.

Note that this utility is limited to utf-8 file names. This is normally used when downloading a attachment to choose the default file name.

§creation_date: Option<DateTime<Utc>>

The creation date of the file (in utc).

§modification_date: Option<DateTime<Utc>>

The last modification date of the file (in utc).

§read_date: Option<DateTime<Utc>>

The date time the file was read, i.e. placed in the mail (in utc).

§size: Option<usize>

The size the file should have.

Note that normally mail explicitly opts to NOT specify the size of a mime-multi part body (e.g. an attachments) and you can never rely on it to e.g. skip ahead. But it has some uses wrt. thinks like external headers.

Implementations§

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
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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.