Skip to main content

qubit_fs/spi/
provider_operation.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// property contract tests.
9//! Provider entry-point identifiers used for facade dispatch.
10
11/// A concrete operation entry point implemented by a filesystem provider.
12///
13/// # Examples
14///
15/// ```rust
16/// use qubit_fs::spi::ProviderOperation;
17///
18/// assert!(matches!(ProviderOperation::Stat, ProviderOperation::Stat));
19/// ```
20#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
21#[repr(u8)]
22#[non_exhaustive]
23pub enum ProviderOperation {
24    /// Reads metadata for one path.
25    Stat = 0,
26    /// Opens a directory listing session.
27    List = 1,
28    /// Opens a file reader.
29    OpenReader = 2,
30    /// Opens a file writer.
31    OpenWriter = 3,
32    /// Creates a directory.
33    CreateDirectory = 4,
34    /// Deletes a file.
35    DeleteFile = 5,
36    /// Deletes a directory.
37    DeleteDirectory = 6,
38    /// Attempts a provider-native copy.
39    TryCopy = 7,
40    /// Renames a resource.
41    Rename = 8,
42    /// Creates a temporary file.
43    CreateTempFile = 9,
44    /// Creates a temporary directory.
45    CreateTempDirectory = 10,
46}