pub struct JobRegistry { /* private fields */ }Expand description
Maps a Job::JOB_TYPE tag back to the concrete type that can
deserialize and run it - built fresh by whatever calls work()
(typically the generated app’s own queue:work branch in main.rs),
not a process-wide static: only one work() loop reads it, in the one
process running it, so there’s no cross-request sharing need the way
larust-events’ listener registry or larust_http::route’s
named-route registry have.
Implementations§
Source§impl JobRegistry
impl JobRegistry
pub fn new() -> Self
Sourcepub fn register<J: Job>(self) -> Self
pub fn register<J: Job>(self) -> Self
Registers J so work() can run it. Panics on a duplicate
J::JOB_TYPE - a startup-time registration collision is a real
programmer bug (the shadowed job type would silently never run its
own handler again); failing loudly and immediately here beats
surfacing it later as “jobs of type X mysteriously stopped
deserializing correctly.”
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for JobRegistry
impl !UnwindSafe for JobRegistry
impl Freeze for JobRegistry
impl Send for JobRegistry
impl Sync for JobRegistry
impl Unpin for JobRegistry
impl UnsafeUnpin for JobRegistry
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<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