Skip to main content

Service

Trait Service 

Source
pub trait Service:
    Send
    + Sync
    + 'static {
    // Required method
    fn call(&self, ctx: TaskContext) -> BoxTaskFuture;
}
Expand description

Service adapter that can be converted into a TaskFactory.

Required Methods§

Source

fn call(&self, ctx: TaskContext) -> BoxTaskFuture

Calls the service for one task attempt.

§Arguments
  • ctx: Per-attempt context passed to the service.
§Returns

Returns a boxed future for the attempt.

Implementors§

Source§

impl<F, Fut> Service for ServiceFn<F>
where F: Fn(TaskContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = TaskResult> + Send + 'static,