Struct Mail
pub struct Mail {
pub headers: MailHeaders,
pub body: BodyType,
}Expand description
Message body representation
Fields§
§headers: MailHeadersMessage body ’s headers
body: BodyTypeMessage body content
Implementations§
§impl Mail
impl Mail
pub fn rewrite_mail_from(&mut self, value: &str)
pub fn rewrite_mail_from(&mut self, value: &str)
change the from field of the header
pub fn rewrite_rcpt(&mut self, old: &str, new: &str)
pub fn rewrite_rcpt(&mut self, old: &str, new: &str)
change one recipients value from @old to @new.
pub fn remove_rcpt(&mut self, old: &str)
pub fn remove_rcpt(&mut self, old: &str)
remove a recipients
pub fn set_header(&mut self, name: &str, value: &str)
pub fn set_header(&mut self, name: &str, value: &str)
rewrite a header with a new value or push it to the header stack.
pub fn rename_header(&mut self, old: &str, new: &str)
pub fn rename_header(&mut self, old: &str, new: &str)
Rename a header.
pub fn get_header(&self, name: &str) -> Option<&str>
pub fn get_header(&self, name: &str) -> Option<&str>
get the value of an header, return None if it does not exists.
pub fn get_header_rev(&self, name: &str) -> Option<&str>
pub fn get_header_rev(&self, name: &str) -> Option<&str>
get the value of an header starting from the end, return None if it does not exists.
pub fn count_header(&self, name: &str) -> usize
pub fn count_header(&self, name: &str) -> usize
Count the number of time a header is present.
pub fn prepend_headers(
&mut self,
headers: impl IntoIterator<Item = (String, String)>,
)
pub fn prepend_headers( &mut self, headers: impl IntoIterator<Item = (String, String)>, )
prepend new headers to the email.
pub fn push_headers(
&mut self,
headers: impl IntoIterator<Item = (String, String)>,
)
pub fn push_headers( &mut self, headers: impl IntoIterator<Item = (String, String)>, )
push new headers to the email.
pub fn remove_header(&mut self, name: &str) -> bool
pub fn remove_header(&mut self, name: &str) -> bool
Remove a header from the list.
Trait Implementations§
§impl<'de> Deserialize<'de> for Mail
impl<'de> Deserialize<'de> for Mail
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Mail
impl StructuralPartialEq for Mail
Auto Trait Implementations§
impl Freeze for Mail
impl RefUnwindSafe for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnwindSafe for Mail
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more