Trait work_queue::Work

source ·
pub trait Work<K, C> {
    type Future: Future;

    // Required method
    fn start(&self, key: K, context: C) -> Self::Future;
}
Expand description

Trait that creates a work future from a key and context.

Required Associated Types§

source

type Future: Future

The future that is executed by the WorkQueue.

Required Methods§

source

fn start(&self, key: K, context: C) -> Self::Future

Create a new Future to be executed by the WorkQueue.

Implementors§

source§

impl<F, K, C, WF> Work<K, C> for F
where F: Fn(K, C) -> WF, WF: Future,

§

type Future = WF