Struct vsmtp_mail_parser::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