pub struct Mail {
pub email: Email,
pub attachments: Vec<MailAttachment>,
}Available on crate feature
mailer and non-WebAssembly only.Fields§
§email: Email§attachments: Vec<MailAttachment>Implementations§
Source§impl Mail
impl Mail
pub fn new(email: Email) -> Self
Sourcepub fn attach(self, attachment: MailAttachment) -> Self
pub fn attach(self, attachment: MailAttachment) -> Self
Add an attachment.
Sourcepub fn deliver_later(self, queue: &JobQueue, transport: Arc<dyn Deliver>)
Available on crate feature jobs only.
pub fn deliver_later(self, queue: &JobQueue, transport: Arc<dyn Deliver>)
jobs only.Send it on queue’s worker threads through transport (with the
queue’s retries), returning at once. Lost if the process exits
first: see enqueue for a persistent queue.
Sourcepub async fn enqueue(
&self,
queue: &PersistentJobQueue,
options: EnqueueOptions,
) -> Result<String, DbError>
Available on crate feature jobs and (crate features model-mysql or model-postgres or model-sqlite) only.
pub async fn enqueue( &self, queue: &PersistentJobQueue, options: EnqueueOptions, ) -> Result<String, DbError>
jobs and (crate features model-mysql or model-postgres or model-sqlite) only.Put it in queue as a MAIL_JOB_TYPE job; a process that called
register_delivery sends it. Returns the job id.
Sourcepub fn to_payload(&self) -> String
pub fn to_payload(&self) -> String
The mail as job payload text: one key=value line per field,
values percent-encoded, attachments’ data in base64.
Sourcepub fn from_payload(text: &str) -> Result<Mail, MailerError>
pub fn from_payload(text: &str) -> Result<Mail, MailerError>
Parse to_payload text.
Trait Implementations§
impl Eq for Mail
impl StructuralPartialEq for Mail
Auto Trait Implementations§
impl Forget for Mail
impl Freeze for Mail
impl RefUnwindSafe for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnsafeUnpin for Mail
impl UnwindSafe for Mail
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more