pub trait Executor:
Clone
+ Sync
+ Send
+ 'static {
// Required methods
fn spawn<F>(&self, future: F)
where F: Future + Send + 'static,
F::Output: Send;
fn spawn_blocking<F, R>(&self, func: F)
where F: FnOnce() -> R + Send + 'static,
R: Send + 'static;
}Required Methods§
Sourcefn spawn<F>(&self, future: F)
fn spawn<F>(&self, future: F)
spawns the task to run in background. This is primarily used by mssf Bridge to execute user app async callbacks/notifications.
Sourcefn spawn_blocking<F, R>(&self, func: F)
fn spawn_blocking<F, R>(&self, func: F)
Runs the provided function on an executor dedicated to blocking operations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".