qubit_fs/write/write_failure_state.rs
1// =============================================================================
2// Copyright (c) 2025 - 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6// Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Recovery states for failed synchronous writes.
9
10/// Provider-confirmed recovery state when a write commit fails.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::write::WriteFailureState;
16///
17/// assert!(matches!(WriteFailureState::NotPublished, WriteFailureState::NotPublished));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20pub enum WriteFailureState {
21 /// Publication can be retried using the retained session.
22 RetryableNotPublished,
23 /// The target was not published and only cleanup remains possible.
24 NotPublished,
25 /// The target was published and only cleanup remains possible.
26 Published,
27 /// The provider cannot determine whether publication occurred.
28 Indeterminate,
29}