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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Named phases shared by synchronous and asynchronous contract suites.
/// One independently executable provider contract phase.
///
/// # Examples
///
/// ```
/// use qubit_fs_testkit::FileSystemContract;
///
/// assert!(FileSystemContract::ALL.contains(&FileSystemContract::Properties));
/// assert_eq!(FileSystemContract::ALL.len(), 12);
/// ```
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum FileSystemContract {
/// Immutable facade properties and fixture path compatibility.
Properties,
/// Metadata identity and provider-neutral file kinds.
Stat,
/// Reads, ranges, conditions, and checksum validation.
Read,
/// Writes, dispositions, conditions, replacement, and abort.
Write,
/// Direct, prefixed, metadata-bearing, and paged listings.
List,
/// Directory creation and recursive ancestor creation.
CreateDirectory,
/// Empty-directory/prefix and symbolic-link representations.
Representations,
/// File, directory, conditional, missing-ok, and recursive deletion.
Delete,
/// Copy methods, conflicts, statistics, and guarantees.
Copy,
/// Rename identity, conflicts, overwrite, and guarantees.
Rename,
/// Temporary file and directory lifecycle and persistence.
TempResources,
/// Structured public error context.
ErrorContext,
}
impl FileSystemContract {
/// Every named contract in dependency-safe execution order.
pub const ALL: [Self; 12] = [
Self::Properties,
Self::Stat,
Self::Read,
Self::Write,
Self::List,
Self::CreateDirectory,
Self::Representations,
Self::Delete,
Self::Copy,
Self::Rename,
Self::TempResources,
Self::ErrorContext,
];
}