Skip to main content

qubit_fs/copy/
async_copy_operation_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// facade tests.
9//! Observable lifecycle state for an owning asynchronous copy operation.
10
11use crate::copy::CopyFailureState;
12
13/// Stable lifecycle state for [`crate::copy::AsyncCopyOperation`].
14///
15/// # Examples
16///
17/// ```rust
18/// use qubit_fs::copy::AsyncCopyOperationState;
19///
20/// assert!(matches!(AsyncCopyOperationState::Ready, AsyncCopyOperationState::Ready));
21/// ```
22#[derive(Clone, Copy, Debug, Eq, PartialEq)]
23pub enum AsyncCopyOperationState {
24    /// The operation passed synchronous preflight and has not been polled.
25    Ready,
26    /// Provider I/O may be in progress.
27    Running,
28    /// A copy outcome was returned successfully.
29    Completed,
30    /// The operation failed with its confirmed publication state.
31    Failed(
32        /// Confirmed destination publication state at failure time.
33        CopyFailureState,
34    ),
35}