qubit_fs/options/atomicity_requirement.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Atomicity requirement used by rename and persist operations.
11
12/// Atomicity requirement for operations that may be downgraded.
13#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14pub enum AtomicityRequirement {
15 /// Use the strongest available implementation but allow downgrade.
16 BestEffort,
17 /// Require atomic behavior or fail with `UnsupportedOperation`.
18 Required,
19}
20
21impl Default for AtomicityRequirement {
22 /// Uses best-effort atomicity by default.
23 #[inline]
24 fn default() -> Self {
25 Self::BestEffort
26 }
27}