Skip to main content

qubit_fs/metadata/
publication_method.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//! Methods used to publish filesystem changes.
9
10/// Concrete method used to publish a successful filesystem change.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::metadata::PublicationMethod;
16///
17/// assert!(matches!(PublicationMethod::Direct, PublicationMethod::Direct));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20pub enum PublicationMethod {
21    /// Bytes were written directly to the destination.
22    Direct,
23    /// A staging resource was atomically renamed into place.
24    AtomicRename,
25    /// A conditional provider operation replaced the destination.
26    ConditionalReplace,
27    /// A provider-native server-side copy published the destination.
28    ServerSideCopy,
29    /// Bytes were streamed through the caller into the destination.
30    StreamCopy,
31    /// A copy was followed by deletion of the source.
32    CopyThenDelete,
33}