Struct 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 duplicate 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 for MessageBody
impl PartialEq for MessageBody
§impl Serialize for MessageBody
impl Serialize for MessageBody
§impl TryFrom<&str> for MessageBody
impl TryFrom<&str> for MessageBody
impl Eq for MessageBody
impl StructuralPartialEq for MessageBody
Auto Trait Implementations§
impl Freeze for MessageBody
impl RefUnwindSafe for MessageBody
impl Send for MessageBody
impl Sync for MessageBody
impl Unpin for MessageBody
impl UnwindSafe for MessageBody
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