Expand description
Message body issued by a SMTP transaction
Variants
Raw
Fields
The raw representation of the message
Parsed(Box<Mail>)
The message parsed using a MailParser
Implementations
impl MessageBody
impl MessageBody
pub fn take_headers(&mut self) -> Vec<String>
pub fn take_headers(&mut self) -> Vec<String>
pub fn to_parsed<P: MailParser>(&mut self) -> Result<()>
pub fn to_parsed<P: MailParser>(&mut self) -> Result<()>
Create a new instance of MessageBody::Parsed, cloning if already parsed
Errors
- Fail to parse using the provided
MailParser
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 or when the body is empty.
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 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.
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.
pub fn prepend_raw_headers(&mut self, to_prepend: impl Iterator<Item = String>)
pub fn prepend_raw_headers(&mut self, to_prepend: impl Iterator<Item = String>)
prepend a set of headers to the header section.
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 · sourcefn 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
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 Display for MessageBody
impl Display for MessageBody
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 ==. Read more
fn ne(&self, other: &MessageBody) -> bool
fn ne(&self, other: &MessageBody) -> bool
This method tests for !=.
impl Serialize for MessageBody
impl Serialize for MessageBody
impl Eq for MessageBody
impl StructuralEq for MessageBody
impl StructuralPartialEq for MessageBody
Auto Trait Implementations
impl RefUnwindSafe for MessageBody
impl Send for MessageBody
impl Sync for MessageBody
impl Unpin for MessageBody
impl UnwindSafe for MessageBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more