pub trait Runnable:
Send
+ Sync
+ 'static {
// Required method
fn run<'async_trait>(
self: Arc<Self>,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Trait for gears that can run a long-running task.
Note: take self by Arc to make the spawned future 'static and Send.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".