[−][src]Struct email_format::Email
Methods
impl Email[src]
pub fn new<F, D>(from: F, date: D) -> Result<Email, ParseError> where
From: TryFrom<F, Error = ParseError>,
OrigDate: TryFrom<D, Error = ParseError>, [src]
From: TryFrom<F, Error = ParseError>,
OrigDate: TryFrom<D, Error = ParseError>,
Create a new email structure. The From address and Date fields are
required in all valid emails, thus you must pass these in.
pub fn set_date<D>(&mut self, date: D) -> Result<(), ParseError> where
OrigDate: TryFrom<D, Error = ParseError>, [src]
OrigDate: TryFrom<D, Error = ParseError>,
Replace the Date field in the email
pub fn get_date(&self) -> OrigDate[src]
Fetch the Date field from the email
pub fn set_from<F>(&mut self, from: F) -> Result<(), ParseError> where
From: TryFrom<F, Error = ParseError>, [src]
From: TryFrom<F, Error = ParseError>,
Replace the From field in the email
pub fn get_from(&self) -> From[src]
Fetch the From field from the email
pub fn set_sender<S>(&mut self, sender: S) -> Result<(), ParseError> where
Sender: TryFrom<S, Error = ParseError>, [src]
Sender: TryFrom<S, Error = ParseError>,
Set or replace the Sender field in the email
pub fn get_sender(&self) -> Option<Sender>[src]
Fetch the Sender field from the email
pub fn clear_sender(&mut self)[src]
Remove the Sender field from the email
pub fn set_reply_to<R>(&mut self, reply_to: R) -> Result<(), ParseError> where
ReplyTo: TryFrom<R, Error = ParseError>, [src]
ReplyTo: TryFrom<R, Error = ParseError>,
Set or replace the Reply-To field in the email
pub fn get_reply_to(&self) -> Option<ReplyTo>[src]
Fetch the Reply-To field from the email
pub fn clear_reply_to(&mut self)[src]
Remove the Reply-To field from the email
pub fn set_to<T>(&mut self, to: T) -> Result<(), ParseError> where
To: TryFrom<T, Error = ParseError>, [src]
To: TryFrom<T, Error = ParseError>,
Set or replace the To field in the email
pub fn get_to(&self) -> Option<To>[src]
Fetch the To field from the email
pub fn clear_to(&mut self)[src]
Remove the To field from the email
pub fn set_cc<C>(&mut self, cc: C) -> Result<(), ParseError> where
Cc: TryFrom<C, Error = ParseError>, [src]
Cc: TryFrom<C, Error = ParseError>,
Set or replace the Cc field in the email
pub fn get_cc(&self) -> Option<Cc>[src]
Fetch the Cc field from the email
pub fn clear_cc(&mut self)[src]
Remove the Cc field from the email
pub fn set_bcc<B>(&mut self, bcc: B) -> Result<(), ParseError> where
Bcc: TryFrom<B, Error = ParseError>, [src]
Bcc: TryFrom<B, Error = ParseError>,
Set or replace the Bcc field in the email
pub fn get_bcc(&self) -> Option<Bcc>[src]
Fetch the Bcc field from the email
pub fn clear_bcc(&mut self)[src]
Remove the Bcc field from the email
pub fn set_message_id<M>(&mut self, message_id: M) -> Result<(), ParseError> where
MessageId: TryFrom<M, Error = ParseError>, [src]
MessageId: TryFrom<M, Error = ParseError>,
Set or replace the Message-ID field in the email
pub fn get_message_id(&self) -> Option<MessageId>[src]
Fetch the Message-ID field from the email
pub fn clear_message_id(&mut self)[src]
Remove the Message-ID field from the email
pub fn set_in_reply_to<I>(&mut self, in_reply_to: I) -> Result<(), ParseError> where
InReplyTo: TryFrom<I, Error = ParseError>, [src]
InReplyTo: TryFrom<I, Error = ParseError>,
Set or replace the In-Reply-To field in the email
pub fn get_in_reply_to(&self) -> Option<InReplyTo>[src]
Fetch the In-Reply-To field from the email
pub fn clear_in_reply_to(&mut self)[src]
Remove the In-Reply-To field from the email
pub fn set_references<R>(&mut self, references: R) -> Result<(), ParseError> where
References: TryFrom<R, Error = ParseError>, [src]
References: TryFrom<R, Error = ParseError>,
Set or replace the References field in the email
pub fn get_references(&self) -> Option<References>[src]
Fetch the References field from the email
pub fn clear_references(&mut self)[src]
Remove the References field from the email
pub fn set_subject<S>(&mut self, subject: S) -> Result<(), ParseError> where
Subject: TryFrom<S, Error = ParseError>, [src]
Subject: TryFrom<S, Error = ParseError>,
Set or replace the Subject field in the email
pub fn get_subject(&self) -> Option<Subject>[src]
Fetch the Subject field from the email
pub fn clear_subject(&mut self)[src]
Remove the Subject field from the email
pub fn add_comments<C>(&mut self, comments: C) -> Result<(), ParseError> where
Comments: TryFrom<C, Error = ParseError>, [src]
Comments: TryFrom<C, Error = ParseError>,
Add a Comments field in the email. This may be in addition to
existing Comments fields.
pub fn get_comments(&self) -> Vec<Comments>[src]
Fetch all Comments fields from the email
pub fn clear_comments(&mut self)[src]
Remove all Comments fields from the email
pub fn add_keywords<K>(&mut self, keywords: K) -> Result<(), ParseError> where
Keywords: TryFrom<K, Error = ParseError>, [src]
Keywords: TryFrom<K, Error = ParseError>,
Add a Keywords field in the email. This may be in addition to existing
Keywords fields.
pub fn get_keywords(&self) -> Vec<Keywords>[src]
Fetch all Keywords fields from the email
pub fn clear_keywords(&mut self)[src]
Remove all Keywords fields from the email
pub fn add_optional_field<O>(
&mut self,
optional_field: O
) -> Result<(), ParseError> where
OptionalField: TryFrom<O, Error = ParseError>, [src]
&mut self,
optional_field: O
) -> Result<(), ParseError> where
OptionalField: TryFrom<O, Error = ParseError>,
Add an optional field to the email. This may be in addition to existing optional fields.
pub fn get_optional_fields(&self) -> Vec<OptionalField>[src]
Fetch all optional fields from the email
pub fn clear_optional_fields(&mut self)[src]
Clear all optional fields from the email
pub fn set_body<B>(&mut self, body: B) -> Result<(), ParseError> where
Body: TryFrom<B, Error = ParseError>, [src]
Body: TryFrom<B, Error = ParseError>,
Set or replace the Body in the email
pub fn get_body(&self) -> Option<Body>[src]
Fetch the Body from the email
pub fn clear_body(&mut self)[src]
Remove the Body from the email, leaving an empty body
pub fn as_bytes(&self) -> Vec<u8>[src]
Stream the email into a byte vector and return that
pub fn as_string(&self) -> String[src]
Stream the email into a byte vector, convert to a String, and return that
Trait Implementations
impl Clone for Email[src]
impl Debug for Email[src]
impl Display for Email[src]
impl Parsable for Email[src]
impl Streamable for Email[src]
Auto Trait Implementations
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnwindSafe for Email
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> From<T> for T[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> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T> TryFrom<T> for T[src]
type Error = ParseError
The type returned in the event of a conversion error.
fn try_from(T) -> Result<T, <T as TryFrom<T>>::Error>[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>,