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::{CasAttemptFailure, CasAttemptFailureKind, CasError, CasErrorKind};
35pub use event::{CasContext, CasEvent, CasHooks};
36pub use executor::{CasBuilder, CasExecutor};
37pub use observability::{
38    CasAlert, CasObservabilityConfig, CasObservabilityMode, ContentionThresholds,
39    ListenerPanicPolicy,
40};
41pub use options::CasTimeoutPolicy;
42pub use report::{CasExecutionOutcome, CasExecutionReport};
43pub use strategy::{CasStrategy, CasStrategyProfile};