Struct EmailMessage
pub struct EmailMessage { /* private fields */ }Expand description
Structured email message primitive.
Implementations§
§impl EmailMessage
impl EmailMessage
pub fn plain_text(
subject: impl Into<String>,
body: impl Into<String>,
) -> EmailMessage
pub fn plain_text( subject: impl Into<String>, body: impl Into<String>, ) -> EmailMessage
Creates a plain text message with subject and body.
pub fn html(subject: impl Into<String>, body: impl Into<String>) -> EmailMessage
pub fn html(subject: impl Into<String>, body: impl Into<String>) -> EmailMessage
Creates an HTML message with subject and body.
pub const fn new(
headers: MessageHeaders,
body: MessageBody,
kind: MessageKind,
) -> EmailMessage
pub const fn new( headers: MessageHeaders, body: MessageBody, kind: MessageKind, ) -> EmailMessage
Creates a message from parts.
pub fn with_header(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<EmailMessage, HeaderParseError>
pub fn with_header( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<EmailMessage, HeaderParseError>
Adds a header and returns the updated message.
pub const fn headers(&self) -> &MessageHeaders
pub const fn headers(&self) -> &MessageHeaders
Returns message headers.
pub const fn body(&self) -> &MessageBody
pub const fn body(&self) -> &MessageBody
Returns the message body.
pub const fn kind(&self) -> MessageKind
pub const fn kind(&self) -> MessageKind
Returns the message kind.
Trait Implementations§
§impl Clone for EmailMessage
impl Clone for EmailMessage
§fn clone(&self) -> EmailMessage
fn clone(&self) -> EmailMessage
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 EmailMessage
impl Debug for EmailMessage
§impl PartialEq for EmailMessage
impl PartialEq for EmailMessage
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