Skip to main content

qubit_executor/executor/
future_executor.rs

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