pub struct MailJob { /* private fields */ }Expand description
Framework-owned - fields are pub(crate), so this is only ever built
by MailBuilder::queue, never constructed (or queued) directly by app
code. registry.register::<larust_support::mail::MailJob>() is a
real registration, no different from any app-defined Job’s - it’s
just that xr new’s scaffold writes that line into every generated
app’s queue:work branch by default, rather than leaving it as a
hint the app author must remember to add.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MailJob
impl<'de> Deserialize<'de> for MailJob
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MailJob, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MailJob, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Job for MailJob
impl Job for MailJob
Source§const JOB_TYPE: &'static str = "__larust_queued_mail"
const JOB_TYPE: &'static str = "__larust_queued_mail"
A stable, explicit, app-chosen tag - deliberately not
std::any::type_name::<Self>(). That string isn’t stable across a
rename/refactor, and a row already sitting in the jobs table
under the old name would silently stop matching any handler.Source§async fn handle(&self) -> Result<(), AppError>
async fn handle(&self) -> Result<(), AppError>
-> impl Future<...> + Send rather than a plain async fn - the
exact spelling larust_auth::Authenticatable::find_for_auth
already established (see docs/GOTCHAS.md) to avoid the
async-fn-in-traits Send-propagation pitfall. Unlike Mailable’s
methods, a job’s handle() is inherently real async I/O (sending
mail, calling an API, writing to the DB), so - unlike Mailable -
there’s no sidestepping this by staying synchronous.Source§impl Serialize for MailJob
impl Serialize for MailJob
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for MailJob
impl RefUnwindSafe for MailJob
impl Send for MailJob
impl Sync for MailJob
impl Unpin for MailJob
impl UnsafeUnpin for MailJob
impl UnwindSafe for MailJob
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more