Skip to main content

qubit_fs/temp/
temp_resource_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//! Temporary resource lifecycle states.
9
10/// Observable lifecycle and recovery state of a temporary resource handle.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::temp::TempResourceState;
16///
17/// assert!(matches!(TempResourceState::Owned, TempResourceState::Owned));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20pub enum TempResourceState {
21    /// The handle owns cleanup responsibility for an unpublished source.
22    Owned,
23    /// The source was successfully published to its final target.
24    Persisted,
25    /// Cleanup responsibility was explicitly released to the caller.
26    Kept,
27    /// The temporary source was explicitly cleaned.
28    Cleaned,
29    /// Only residual cleanup is permitted; this does not imply publication.
30    CleanupRequired,
31    /// The provider cannot determine the final source or target state.
32    Indeterminate,
33}