Skip to main content

qubit_cas/observability/
cas_observability_mode.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
11/// Observability mode used by the executor.
12#[derive(Debug, Clone, Copy, PartialEq, Eq)]
13pub enum CasObservabilityMode {
14    /// Produce only the final execution report.
15    ReportOnly,
16    /// Emit lifecycle events to registered listeners.
17    EventStream,
18    /// Emit lifecycle events and contention alerts.
19    EventStreamWithAlert,
20}
21
22impl Default for CasObservabilityMode {
23    /// Returns the lowest-overhead observability mode.
24    ///
25    /// # Returns
26    /// [`CasObservabilityMode::ReportOnly`] (no events or alerts).
27    #[inline]
28    fn default() -> Self {
29        Self::ReportOnly
30    }
31}