Struct mail_core::Source

source ·
pub struct Source {
    pub iri: IRI,
    pub use_media_type: UseMediaType,
    pub use_file_name: Option<String>,
}
Expand description

POD containing the IRI which should be used to laod a resource well as an optional file name to use and a description about how the content type should be handled.

Fields

iri: IRI

A International Resource Identifier pointing to a source from which the Resource can be loaded. Note that the interpretation of the IRI is left to the ResourceLoader implementation of the context. The ResourceLoader can decide to reject valid IRI’s e.g. a (non local) http url is likely to be rejected by any implementation.

use_media_type: UseMediaType

Allows specifying how the media type detection is done.

use_file_name: Option<String>

Allows providing a explicit name overriding any inferred name.

If a resource if loaded from a IRI it potentially can contain a inferred name e.g. for loading a file secret_thing.png it would be just that file name, but you potentially want to provide a name which differs from the name the file has in the file system in which case you can provide a name here.

Note that file names are optional and don’t need to be provided at all. But it is strongly recommended to provide them for anything used as attachment but normally irrelevant for anything else.

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

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.