Skip to main content

qubit_fs/error/
fs_error_kind.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//! Filesystem error categories.
11
12/// Provider-neutral filesystem error category.
13#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14pub enum FsErrorKind {
15    /// The requested resource does not exist.
16    NotFound,
17    /// The target resource already exists.
18    AlreadyExists,
19    /// A path component expected to be a directory is not a directory.
20    NotDirectory,
21    /// The requested operation expected a file but found a directory.
22    IsDirectory,
23    /// A path or URI is invalid for the selected filesystem.
24    InvalidPath,
25    /// The current credentials do not grant the requested operation.
26    PermissionDenied,
27    /// Authentication failed before authorization could be evaluated.
28    AuthenticationFailed,
29    /// The selected provider is unavailable in the current environment.
30    ProviderUnavailable,
31    /// The filesystem model does not support the requested operation.
32    UnsupportedOperation,
33    /// The operation conflicts with current filesystem state.
34    Conflict,
35    /// A conditional operation failed its precondition.
36    PreconditionFailed,
37    /// The operation timed out.
38    Timeout,
39    /// The operation was interrupted.
40    Interrupted,
41    /// A quota, capacity, or storage limit was exceeded.
42    QuotaExceeded,
43    /// Stored or transferred data failed integrity validation.
44    DataCorruption,
45    /// A lower-level local or remote I/O error occurred.
46    Io,
47    /// An error occurred that does not fit a more specific category.
48    Other,
49}