Skip to main content

qubit_executor/executor/
future_executor.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025 - 2026.
4 *    Haixing Hu, Qubit Co. Ltd.
5 *
6 *    All rights reserved.
7 *
8 ******************************************************************************/
9use super::Executor;
10
11/// Marker trait for executors whose execution carrier is a future.
12///
13/// A `FutureExecutor` is still an [`Executor`]: it executes
14/// [`Runnable`](qubit_function::Runnable) and
15/// [`Callable`](qubit_function::Callable) tasks through [`Executor::execute`]
16/// and [`Executor::call`].
17/// Its distinguishing contract is that `Self::Execution<R, E>` should be a
18/// future resolving to `Result<R, E>`.
19///
20/// Rust cannot currently express this contract for all `R` and `E` directly in
21/// the trait definition, so implementations must document and uphold it.
22///
23/// # Author
24///
25/// Haixing Hu
26pub trait FutureExecutor: Executor {}