pub struct EmailMessage { /* private fields */ }Expand description
Structured email message primitive.
Implementations§
Source§impl EmailMessage
impl EmailMessage
Sourcepub fn plain_text(subject: impl Into<String>, body: impl Into<String>) -> Self
pub fn plain_text(subject: impl Into<String>, body: impl Into<String>) -> Self
Creates a plain text message with subject and body.
Sourcepub fn html(subject: impl Into<String>, body: impl Into<String>) -> Self
pub fn html(subject: impl Into<String>, body: impl Into<String>) -> Self
Creates an HTML message with subject and body.
Sourcepub const fn new(
headers: MessageHeaders,
body: MessageBody,
kind: MessageKind,
) -> Self
pub const fn new( headers: MessageHeaders, body: MessageBody, kind: MessageKind, ) -> Self
Creates a message from parts.
Sourcepub fn with_header(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<Self, HeaderParseError>
pub fn with_header( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<Self, HeaderParseError>
Adds a header and returns the updated message.
Sourcepub const fn headers(&self) -> &MessageHeaders
pub const fn headers(&self) -> &MessageHeaders
Returns message headers.
Sourcepub const fn body(&self) -> &MessageBody
pub const fn body(&self) -> &MessageBody
Returns the message body.
Sourcepub const fn kind(&self) -> MessageKind
pub const fn kind(&self) -> MessageKind
Returns the message kind.
Trait Implementations§
Source§impl Clone for EmailMessage
impl Clone for EmailMessage
Source§fn clone(&self) -> EmailMessage
fn clone(&self) -> EmailMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmailMessage
impl Debug for EmailMessage
Source§impl PartialEq for EmailMessage
impl PartialEq for EmailMessage
Source§fn eq(&self, other: &EmailMessage) -> bool
fn eq(&self, other: &EmailMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for EmailMessage
impl StructuralPartialEq for EmailMessage
Auto Trait Implementations§
impl Freeze for EmailMessage
impl RefUnwindSafe for EmailMessage
impl Send for EmailMessage
impl Sync for EmailMessage
impl Unpin for EmailMessage
impl UnsafeUnpin for EmailMessage
impl UnwindSafe for EmailMessage
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