1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Provider-neutral write scenarios with fixed contract expectations.
/// The write behavior whose request a fixture prepares.
///
/// # Examples
///
/// ```
/// use qubit_fs_testkit::WriteScenario;
///
/// assert_eq!(WriteScenario::Create, WriteScenario::Create);
/// assert_ne!(WriteScenario::Replace, WriteScenario::Append);
/// ```
#[must_use]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum WriteScenario {
/// Publish bytes to a previously absent destination.
Create,
/// Open a fresh CreateNew writer for explicit abort without committing.
Abort,
/// Attempt CreateNew against an independently seeded existing target.
CreateConflict,
/// Replace the entire contents of an existing destination.
/// The initial contents must be longer than the payload to verify
/// truncation.
Replace,
/// Append bytes to an existing destination.
/// Preparation must supply nonempty initial contents for independent
/// observation.
Append,
/// Write with an explicit absence precondition.
IfAbsent,
/// Write with the current destination version as a precondition.
IfMatch,
/// Replace an existing destination with required atomicity.
/// Initial contents must differ from the requested replacement bytes.
AtomicReplace,
/// Publish bytes with required durability.
/// The prepared request uses CreateNew at a previously absent destination.
Durable,
}