Skip to main content

FutureExecutor

Trait FutureExecutor 

Source
pub trait FutureExecutor: Executor { }
Expand description

Marker trait for executors whose execution carrier is a future.

A FutureExecutor is still an Executor: it executes Runnable and Callable tasks through Executor::execute and Executor::call. Its distinguishing contract is that Self::Execution<R, E> should be a future resolving to Result<R, E>.

Rust cannot currently express this contract for all R and E directly in the trait definition, so implementations must document and uphold it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§