pub trait ExecutorTimeout: Executor {
// Provided methods
fn spawn_timeout<F>(
&self,
duration: Duration,
f: F,
) -> JoinHandle<Result<F::Output, TimeoutError>> ⓘ
where F: Future + Send + 'static,
F::Output: Send + 'static { ... }
fn spawn_delay<F>(&self, duration: Duration, f: F) -> JoinHandle<F::Output> ⓘ
where F: Future + Send + 'static,
F::Output: Send + 'static { ... }
fn spawn_abortable_timeout<F>(
&self,
duration: Duration,
f: F,
) -> AbortableJoinHandle<Result<F::Output, TimeoutError>> ⓘ
where F: Future + Send + 'static,
F::Output: Send + 'static { ... }
fn spawn_abortable_delay<F>(
&self,
duration: Duration,
f: F,
) -> AbortableJoinHandle<F::Output> ⓘ
where F: Future + Send + 'static,
F::Output: Send + 'static { ... }
}Provided Methods§
Sourcefn spawn_timeout<F>(
&self,
duration: Duration,
f: F,
) -> JoinHandle<Result<F::Output, TimeoutError>> ⓘ
fn spawn_timeout<F>( &self, duration: Duration, f: F, ) -> JoinHandle<Result<F::Output, TimeoutError>> ⓘ
Spawns a new asynchronous task in the background that must complete within duration,
returning a JoinHandle.
If the future does not finish before duration elapses, it is dropped and the task
completes with TimeoutError.
Sourcefn spawn_delay<F>(&self, duration: Duration, f: F) -> JoinHandle<F::Output> ⓘ
fn spawn_delay<F>(&self, duration: Duration, f: F) -> JoinHandle<F::Output> ⓘ
Spawns a task after waiting for a duration before the task is polled.
Sourcefn spawn_abortable_timeout<F>(
&self,
duration: Duration,
f: F,
) -> AbortableJoinHandle<Result<F::Output, TimeoutError>> ⓘ
fn spawn_abortable_timeout<F>( &self, duration: Duration, f: F, ) -> AbortableJoinHandle<Result<F::Output, TimeoutError>> ⓘ
Spawns a new asynchronous task in the background that must complete within duration,
returning an abortable handle that will cancel the task once the handle is dropped.
If the future does not finish before duration elapses, it is dropped and the task
completes with TimeoutError.
Sourcefn spawn_abortable_delay<F>(
&self,
duration: Duration,
f: F,
) -> AbortableJoinHandle<F::Output> ⓘ
fn spawn_abortable_delay<F>( &self, duration: Duration, f: F, ) -> AbortableJoinHandle<F::Output> ⓘ
Spawns an abortable task after waiting for duration before the task is polled.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".