Struct vsmtp_mail_parser::MessageBody
pub struct MessageBody { /* private fields */ }Expand description
Message body issued by a SMTP transaction
Implementations§
§impl MessageBody
impl MessageBody
pub const fn get_parsed(&self) -> &Option<Mail>
pub const fn get_parsed(&self) -> &Option<Mail>
Get the parsed part
pub fn get_header(&self, name: &str) -> Option<String>
pub fn get_header(&self, name: &str) -> Option<String>
get the value of an header, return None if it does not exists or when the body is empty.
pub fn count_header(&self, name: &str) -> usize
pub fn count_header(&self, name: &str) -> usize
Count the number of headers with the given name.
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 add it to the header section.
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 append_header(&mut self, name: &str, value: &str)
pub fn append_header(&mut self, name: &str, value: &str)
push a header to the header section.
push back
pub fn prepend_header(&mut self, name: &str, value: &str)
pub fn prepend_header(&mut self, name: &str, value: &str)
prepend a header to the header section.
push front
pub fn remove_header(&mut self, name: &str) -> bool
pub fn remove_header(&mut self, name: &str) -> bool
Remove a header from the list.
pub fn parse<P: MailParser>(&mut self) -> Result<()>
pub fn parse<P: MailParser>(&mut self) -> Result<()>
Errors
- the value produced by the
MailParserwas not a parsedMail - Fail to parse using the provided
MailParser
pub fn parsed<P: MailParser>(&mut self) -> Result<&mut Mail>
pub fn parsed<P: MailParser>(&mut self) -> Result<&mut Mail>
Errors
- error from
Self::parse
Trait Implementations§
§impl Clone for MessageBody
impl Clone for MessageBody
§fn clone(&self) -> MessageBody
fn clone(&self) -> MessageBody
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for MessageBody
impl Debug for MessageBody
§impl Default for MessageBody
impl Default for MessageBody
§fn default() -> MessageBody
fn default() -> MessageBody
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for MessageBody
impl<'de> Deserialize<'de> for MessageBody
§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 PartialEq<MessageBody> for MessageBody
impl PartialEq<MessageBody> for MessageBody
§fn eq(&self, other: &MessageBody) -> bool
fn eq(&self, other: &MessageBody) -> bool
This method tests for
self and other values to be equal, and is used
by ==.