[−][src]Struct mail::EncodableMail
a mail with all contained futures resolved, so that it can be encoded
Implementations
impl EncodableMail
[src]
pub fn encode(&self, encoder: &mut EncodingBuffer) -> Result<(), MailError>
[src]
Encode the mail using the given encoding buffer.
After encoding succeeded the buffer should contain a fully encoded mail including all attachments, embedded images alternate bodies etc.
Error
This can fail for a large number of reasons, e.g. some input can not be encoded with the given mail type or some headers/resources breack the mails hard line length limit.
pub fn encode_into_bytes(
&self,
mail_type: MailType
) -> Result<Vec<u8>, MailError>
[src]
&self,
mail_type: MailType
) -> Result<Vec<u8>, MailError>
A wrapper for encode
which will create a buffer, enocde the mail and then returns the buffers content.
Methods from Deref<Target = Mail>
pub fn has_multipart_body(&self) -> bool
[src]
Returns true if the body of the mail is a multipart body.
pub fn headers(&self) -> &HeaderMap
[src]
Returns a reference to the currently set headers.
Note that some headers namely Content-Transfer-Encoding
as well
as Content-Type
for singlepart mails are derived from the content
and should not be set. If done so they are either ignored or an
error is caused by them in other parts of the crate (like e.g. encoding).
Also Date
is auto-generated if not set and it is needed.
pub fn body(&self) -> &MailBody
[src]
Returns a reference to the body/bodies.
pub fn generally_validate_mail(&self) -> Result<(), MailError>
[src]
Validate the mail.
This will mainly validate the mail headers by
- checking if no ContentTransferHeader is given
- (for mails with multipart bodies) checking if the content type
is a
multipart
media type - (for mail with non-multipart bodies) check if there is no
content type header (as the content type header will be derived
from he
Resource
) - running all header validators (with
use_contextual_validators
) this also checks for "max one" consistency (seeHeaderMap
's documentation for more details) - doing this recursively with all contained mails
Note that this will be called by into_encodable_mail
, therefor
it is normally not required to call this function by yourself.
Be aware that this does a general validation applicable to both the
top level headers and headers from multipart mail sub bodies. This
means it e.g. doesn't check if there are any of the required headers
(Date
and From
).
Trait Implementations
impl Clone for EncodableMail
[src]
fn clone(&self) -> EncodableMail
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EncodableMail
[src]
impl Deref for EncodableMail
[src]
type Target = Mail
The resulting type after dereferencing.
fn deref(&self) -> &<EncodableMail as Deref>::Target
[src]
impl Into<Mail> for EncodableMail
[src]
Auto Trait Implementations
impl !RefUnwindSafe for EncodableMail
impl Send for EncodableMail
impl Sync for EncodableMail
impl Unpin for EncodableMail
impl !UnwindSafe for EncodableMail
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> HeaderTryFrom<T> for T
[src]
fn try_from(val: T) -> Result<T, ComponentCreationError>
[src]
impl<F, T> HeaderTryInto<T> for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,
fn try_into(self) -> Result<T, ComponentCreationError>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,