pub struct WorkerBuilder<Req, Ctx, Source, Middleware, Serv> { /* private fields */ }Expand description
Allows building a Worker.
Usually the output is Worker<Ready>
Implementations§
Source§impl<Serv> WorkerBuilder<(), (), (), Identity, Serv>
impl<Serv> WorkerBuilder<(), (), (), Identity, Serv>
Sourcepub fn new<T: AsRef<str>>(name: T) -> WorkerBuilder<(), (), (), Identity, Serv>
pub fn new<T: AsRef<str>>(name: T) -> WorkerBuilder<(), (), (), Identity, Serv>
Build a new WorkerBuilder instance with a name for the worker to build
Source§impl<M, Serv> WorkerBuilder<(), (), (), M, Serv>
impl<M, Serv> WorkerBuilder<(), (), (), M, Serv>
Source§impl<Req, M, Serv, Ctx> WorkerBuilder<Req, Ctx, (), M, Serv>
impl<Req, M, Serv, Ctx> WorkerBuilder<Req, Ctx, (), M, Serv>
Sourcepub fn chain<NewLayer>(
self,
f: impl FnOnce(ServiceBuilder<M>) -> ServiceBuilder<NewLayer>,
) -> WorkerBuilder<Req, Ctx, (), NewLayer, Serv>
pub fn chain<NewLayer>( self, f: impl FnOnce(ServiceBuilder<M>) -> ServiceBuilder<NewLayer>, ) -> WorkerBuilder<Req, Ctx, (), NewLayer, Serv>
Allows of decorating the service that consumes jobs.
Allows adding multiple tower middleware
Trait Implementations§
Source§impl<Req, Ctx, Source, Middleware, Serv> Debug for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> Debug for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
Source§impl<Req, P, M, S, Ctx> WorkerFactory<Req, Ctx, S> for WorkerBuilder<Req, Ctx, P, M, S>
impl<Req, P, M, S, Ctx> WorkerFactory<Req, Ctx, S> for WorkerBuilder<Req, Ctx, P, M, S>
Auto Trait Implementations§
impl<Req, Ctx, Source, Middleware, Serv> Freeze for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> !RefUnwindSafe for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> Send for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> Sync for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> Unpin for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
impl<Req, Ctx, Source, Middleware, Serv> !UnwindSafe for WorkerBuilder<Req, Ctx, Source, Middleware, Serv>
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
Source§impl<Req, W, F, Ctx, FnArgs> WorkerFactoryFn<Req, Ctx, F, FnArgs> for Wwhere
W: WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>,
impl<Req, W, F, Ctx, FnArgs> WorkerFactoryFn<Req, Ctx, F, FnArgs> for Wwhere
W: WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>,
Source§type Source = <W as WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>>::Source
type Source = <W as WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>>::Source
The request source for the
WorkerSource§type Service = <W as WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>>::Service
type Service = <W as WorkerFactory<Req, Ctx, ServiceFn<F, Req, Ctx, FnArgs>>>::Service
The service that the worker will run jobs against
Source§fn build_fn(
self,
f: F,
) -> Worker<Ready<<W as WorkerFactoryFn<Req, Ctx, F, FnArgs>>::Service, <W as WorkerFactoryFn<Req, Ctx, F, FnArgs>>::Source>>
fn build_fn( self, f: F, ) -> Worker<Ready<<W as WorkerFactoryFn<Req, Ctx, F, FnArgs>>::Service, <W as WorkerFactoryFn<Req, Ctx, F, FnArgs>>::Source>>
Builds a
WorkerFactoryFn using ServiceFn
that can be used to generate new Worker using the build_fn method Read more