Struct mail_core::Data

source ·
pub struct Data { /* private fields */ }
Expand description

A type containing some data and metadata for it.

This often, but not always, corresponds to data which could potentially have been a file in a file system. For example a image or a text document.

This type is mainly used when having auto generated content as content provided through a file should be loaded from a source and as such will be directly loaded and transfer encoded.

Clone

Data is made to be cheap to clone and share. For this it uses Arc internally.

Implementations

Create a new data instance.

Access the raw data buffer of this instance.

Access the metadata.

Access the file meta metadata.Fn

Access the content type.

Access the content id.

Transfer encode the given data.

This function will be called by the context implementation when loading and/or transfer encoding data. The context implementation might also not call it if it has a cached version of the transfer encoded data.

This functions expect a boundary pool and will remove all boundaries which do appear in the encoded representation of the data.

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.