qubit_fs/temp/persist_failure_state.rs
1// =============================================================================
2// Copyright (c) 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6// Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Partial-progress states for failed temporary persistence.
9
10/// Provider-confirmed progress when a persist call does not fully complete.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::temp::PersistFailureState;
16///
17/// assert!(matches!(PersistFailureState::NotPublished, PersistFailureState::NotPublished));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20pub enum PersistFailureState {
21 /// The target was not published and the handle still owns the source.
22 NotPublished,
23 /// The target was not published, but source mutation authority is
24 /// uncertain.
25 NotPublishedSourceIndeterminate,
26 /// The target was not published and only residual cleanup is permitted.
27 NotPublishedSourceCleanupRequired,
28 /// The target was not published and the handle released its source.
29 NotPublishedSourceReleased,
30 /// The target was published, but the handle still owns source cleanup.
31 PublishedSourceRetained,
32 /// The target was published, but source mutation authority is uncertain.
33 PublishedSourceIndeterminate,
34 /// The target was published and the handle released its source.
35 PublishedSourceReleased,
36 /// The provider cannot determine the final target or source state.
37 Indeterminate,
38}