Skip to main content

qubit_fs/write/
async_write_all_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//! State for an owning asynchronous whole-file write.
9use crate::write::WriteFailureState;
10/// Lifecycle state of an owning asynchronous whole-file write.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::write::AsyncWriteAllOperationState;
16///
17/// assert!(matches!(AsyncWriteAllOperationState::Ready, AsyncWriteAllOperationState::Ready));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20#[must_use]
21pub enum AsyncWriteAllOperationState {
22    /// The operation has not been polled.
23    Ready,
24    /// The provider call is in progress and has not completed.
25    Running,
26    /// The target was published successfully.
27    Completed,
28    /// The operation stopped with the paired publication state.
29    Failed(WriteFailureState),
30}