pub trait BlockingExecutor:
Send
+ Sync
+ 'static {
// Required method
fn execute(&self, work: Box<dyn FnOnce() + Send + 'static>);
}Available on crate feature
async only.Expand description
Somewhere to run blocking work from an async context.
Implement this to hand the crate your runtime’s blocking pool. Without one it spawns a thread per call, which is correct everywhere and cheap enough for work that happens at startup and on reload.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".