[−][src]Trait mobc::executor::Executor
A value that executes futures. see tokio::Executor
Required methods
fn spawn(
&mut self,
future: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Result<(), SpawnError>
&mut self,
future: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Result<(), SpawnError>
Spawns a future object to run on this executor.
future
is passed to the executor, which will begin running it. The
future may run on the current thread or another thread at the discretion
of the Executor
implementation.
Provided methods
fn status(&self) -> Result<(), SpawnError>
Provides a best effort hint to whether or not spawn
will succeed.
This function may return both false positives and false negatives.
If status
returns Ok
, then a call to spawn
will probably
succeed, but may fail. If status
returns Err
, a call to spawn
will
probably fail, but may succeed.
This allows a caller to avoid creating the task if the call to spawn
has a high likelihood of failing.