pub struct TypedWorkerAdapter<W: TypedWorker> { /* private fields */ }Expand description
Adapter that wraps a TypedWorker and implements the untyped
Worker trait, deserializing job.payload into W::Args before
dispatching.
Implementations§
Source§impl<W: TypedWorker> TypedWorkerAdapter<W>
impl<W: TypedWorker> TypedWorkerAdapter<W>
Trait Implementations§
Source§impl<W> Worker for TypedWorkerAdapter<W>where
W: TypedWorker + 'static,
impl<W> Worker for TypedWorkerAdapter<W>where
W: TypedWorker + 'static,
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job: &'life1 Job,
context: &'life2 WorkerContext,
) -> Pin<Box<dyn Future<Output = Result<WorkerResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job: &'life1 Job,
context: &'life2 WorkerContext,
) -> Pin<Box<dyn Future<Output = Result<WorkerResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a job.
Source§fn method_name(&self) -> &str
fn method_name(&self) -> &str
Get the method name this worker handles
Source§fn can_handle(&self, method: &str) -> bool
fn can_handle(&self, method: &str) -> bool
Check if this worker can handle the given job method
Auto Trait Implementations§
impl<W> Freeze for TypedWorkerAdapter<W>where
W: Freeze,
impl<W> RefUnwindSafe for TypedWorkerAdapter<W>where
W: RefUnwindSafe,
impl<W> Send for TypedWorkerAdapter<W>
impl<W> Sync for TypedWorkerAdapter<W>
impl<W> Unpin for TypedWorkerAdapter<W>where
W: Unpin,
impl<W> UnsafeUnpin for TypedWorkerAdapter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for TypedWorkerAdapter<W>where
W: UnwindSafe,
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