qubit_fs/options/copy_outcome.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Copy operation outcome.
11
12use qubit_metadata::Metadata;
13
14use crate::{
15 CopyMethod,
16 CopyStats,
17};
18
19/// Outcome returned by copy operations.
20#[derive(Clone, Debug, PartialEq)]
21pub struct CopyOutcome {
22 /// Copy statistics.
23 pub stats: CopyStats,
24 /// Method used to complete the copy.
25 pub method: CopyMethod,
26 /// Provider-native diagnostics.
27 pub diagnostics: Metadata,
28}
29
30impl CopyOutcome {
31 /// Creates a copy outcome.
32 ///
33 /// # Parameters
34 /// - `stats`: Copy statistics.
35 /// - `method`: Method used to complete the copy.
36 ///
37 /// # Returns
38 /// New copy outcome without diagnostics.
39 #[inline]
40 #[must_use]
41 pub fn new(stats: CopyStats, method: CopyMethod) -> Self {
42 Self {
43 stats,
44 method,
45 diagnostics: Metadata::new(),
46 }
47 }
48}