Skip to main content

Dispatchable

Trait Dispatchable 

Source
pub trait Dispatchable: Send + 'static {
    // Required method
    fn run(self: Box<Self>);
}
Expand description

A trait for dispatching a closure.

Used by AsyncifyPool to run closures in other threads.

It’s implemented for all FnOnce() + Send + 'static but may also be implemented for any other types that are Send and 'static.

Required Methods§

Source

fn run(self: Box<Self>)

Run the dispatchable

Implementors§

Source§

impl<F> Dispatchable for F
where F: FnOnce() + Send + 'static,