Skip to main content

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};
42pub use callable_with::{
43    ArcCallableWith,
44    BoxCallableWith,
45    CallableWith,
46    RcCallableWith,
47};
48pub use runnable::{
49    ArcRunnable,
50    BoxRunnable,
51    RcRunnable,
52    Runnable,
53};
54pub use runnable_once::{
55    BoxRunnableOnce,
56    RunnableOnce,
57};
58pub use runnable_with::{
59    ArcRunnableWith,
60    BoxRunnableWith,
61    RcRunnableWith,
62    RunnableWith,
63};