qubit_function/tasks/mod.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 ******************************************************************************/
10//! # Task Function Module
11//!
12//! Provides zero-argument task-oriented functional abstractions.
13//!
14//! `Callable` represents a reusable computation that returns `Result<R, E>`.
15//! `Runnable` represents a reusable action that returns `Result<(), E>`. Both
16//! abstractions are intentionally fallible and support task submission in
17//! executor-style workflows.
18//! `CallableWith` and `RunnableWith` are their mutable-input counterparts for
19//! executor APIs that pass protected state into the task.
20//!
21//! One-time equivalents are also provided as `CallableOnce` and `RunnableOnce`
22//! for move-only callable use cases.
23//!
24
25pub mod callable;
26pub mod callable_once;
27pub mod callable_with;
28pub mod runnable;
29pub mod runnable_once;
30pub mod runnable_with;
31
32pub use callable::{
33 ArcCallable,
34 BoxCallable,
35 Callable,
36 RcCallable,
37};
38pub use callable_once::{
39 BoxCallableOnce,
40 CallableOnce,
41 LocalBoxCallableOnce,
42};
43pub use callable_with::{
44 ArcCallableWith,
45 BoxCallableWith,
46 CallableWith,
47 RcCallableWith,
48};
49pub use runnable::{
50 ArcRunnable,
51 BoxRunnable,
52 RcRunnable,
53 Runnable,
54};
55pub use runnable_once::{
56 BoxRunnableOnce,
57 LocalBoxRunnableOnce,
58 RunnableOnce,
59};
60pub use runnable_with::{
61 ArcRunnableWith,
62 BoxRunnableWith,
63 RcRunnableWith,
64 RunnableWith,
65};