Worker

Trait Worker 

Source
pub trait Worker {
    // Required method
    fn run(&mut self) -> impl Future<Output = ()> + Send;
}
Expand description

Trait representing a generic worker.

The worker runs an async looping function running periodic tasks.

This trait can be used to provide wrapper around a worker.

Required Methods§

Source

fn run(&mut self) -> impl Future<Output = ()> + Send

Main worker loop

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§