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