Skip to main content

qubit_cas/
lib.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//! Typed compare-and-swap executor for synchronous and asynchronous workflows.
11//!
12//! `CasExecutor<T, E>` binds the shared state type `T` and operation error type
13//! `E`. Each execution call introduces its own business output type `R`, so one
14//! executor configuration can serve multiple CAS operations over the same state.
15
16#![deny(missing_docs)]
17#![deny(unsafe_op_in_unsafe_fn)]
18
19mod cas_decision;
20mod cas_outcome;
21mod cas_success;
22pub mod constants;
23pub mod error;
24pub mod event;
25pub mod executor;
26pub mod observability;
27pub mod options;
28pub mod report;
29pub mod strategy;
30
31pub use cas_decision::CasDecision;
32pub use cas_outcome::CasOutcome;
33pub use cas_success::CasSuccess;
34pub use error::{
35    CasAttemptFailure,
36    CasAttemptFailureKind,
37    CasError,
38    CasErrorKind,
39};
40pub use event::{
41    CasContext,
42    CasEvent,
43    CasHooks,
44};
45pub use executor::{
46    CasBuilder,
47    CasExecutor,
48};
49pub use observability::{
50    CasAlert,
51    CasObservabilityConfig,
52    CasObservabilityMode,
53    ContentionThresholds,
54    ListenerPanicPolicy,
55};
56pub use options::CasTimeoutPolicy;
57pub use report::{
58    CasExecutionOutcome,
59    CasExecutionReport,
60};
61pub use strategy::{
62    CasStrategy,
63    CasStrategyProfile,
64};