qubit_fs/spi/copy_attempt.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.
9//! Optional provider copy results.
10
11use super::CopyDeclineReason;
12use crate::copy::CopyOutcome;
13
14/// Optional provider copy result.
15///
16/// # Examples
17///
18/// ```rust
19/// use qubit_fs::copy::{CopyMethod, CopyOutcome, CopyStats};
20/// use qubit_fs::metadata::AchievedAtomicity;
21/// use qubit_fs::spi::{CopyAttempt, CopyDeclineReason};
22///
23/// let attempt = CopyAttempt::Completed(CopyOutcome::new(
24/// CopyStats::default(),
25/// CopyMethod::Native,
26/// AchievedAtomicity::Atomic,
27/// ));
28/// assert!(matches!(attempt, CopyAttempt::Completed(_)));
29/// let declined = CopyAttempt::Declined(CopyDeclineReason::NotApplicable);
30/// assert!(matches!(declined, CopyAttempt::Declined(_)));
31/// ```
32#[non_exhaustive]
33pub enum CopyAttempt {
34 /// A provider completed the copy.
35 Completed(
36 /// Provider-confirmed completed copy outcome.
37 CopyOutcome,
38 ),
39 /// The facade may select its later fallback.
40 Declined(
41 /// Reason the provider declined native execution.
42 CopyDeclineReason,
43 ),
44}