Struct vsmtp_common::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 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 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.
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 StructuralEq for Mail
impl StructuralPartialEq for Mail
Auto Trait Implementations
impl RefUnwindSafe for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnwindSafe for Mail
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