pub struct WorkerRegistry { /* private fields */ }
Expand description
Registry for job workers
This registry maps job method names to their corresponding worker implementations. It’s used by the job processor to find the appropriate worker for each job.
Implementations§
Source§impl WorkerRegistry
impl WorkerRegistry
Sourcepub fn register<W>(&mut self, worker: W)where
W: Worker + 'static,
pub fn register<W>(&mut self, worker: W)where
W: Worker + 'static,
Register a worker for a specific method
Sourcepub fn get_worker(&self, method: &str) -> Option<&dyn Worker>
pub fn get_worker(&self, method: &str) -> Option<&dyn Worker>
Get a worker for the given method name
Sourcepub fn get_methods(&self) -> Vec<&str>
pub fn get_methods(&self) -> Vec<&str>
Get all registered method names
Sourcepub fn has_worker(&self, method: &str) -> bool
pub fn has_worker(&self, method: &str) -> bool
Check if a method is registered
Trait Implementations§
Source§impl Default for WorkerRegistry
impl Default for WorkerRegistry
Source§fn default() -> WorkerRegistry
fn default() -> WorkerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorkerRegistry
impl !RefUnwindSafe for WorkerRegistry
impl Send for WorkerRegistry
impl Sync for WorkerRegistry
impl Unpin for WorkerRegistry
impl !UnwindSafe for WorkerRegistry
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