standard_lib/fs/
error.rs

1use derive_more::{Display, Error};
2
3#[derive(Debug, Display, Clone, Error)]
4#[display("interrupted by signal")]
5pub struct InterruptError;
6
7#[derive(Debug, Display, Clone, Error)]
8#[display("error during I/O")]
9pub struct IOError;
10
11#[derive(Debug, Display, Clone, Error)]
12#[display("available storage space exhausted")]
13pub struct StorageExhaustedError;
14
15#[derive(Debug, Display, Clone, Error)]
16#[display("sync not supported by file")]
17pub struct SyncUnsupportedError;
18
19#[derive(Debug, Display, Clone, Error)]
20#[display("temp file not supported by filesystem")]
21pub struct TempFileUnsupportedError;
22
23#[derive(Debug, Display, Clone, Error)]
24#[display("file metadata would overflow capacity")]
25pub struct MetadataOverflowError;
26
27#[derive(Debug, Display, Clone, Error)]
28#[display("out of memory")]
29pub struct OOMError;
30
31#[derive(Debug, Display, Clone, Error)]
32#[display("exceeded open file limit for process")]
33pub struct FileCountError;
34
35#[derive(Debug, Display, Clone, Error)]
36#[display("exceeded memory for allocating locks")]
37pub struct LockMemError;
38
39#[derive(Debug, Display, Clone, Error)]
40#[display("operation would block but called via non-blocking method")]
41pub struct WouldBlockError;
42
43#[derive(Debug, Display, Clone, Error)]
44#[display("directory no longer exists")]
45pub struct RemovedDirectoryError;
46
47#[derive(Debug, Display, Clone, Error)]
48#[display("search permission is denied for one of the directories in the provided path")]
49pub struct NoSearchError;
50
51#[derive(Debug, Display, Clone, Error)]
52#[display("path contains too many symlinks")]
53pub struct ExcessiveLinksError;
54
55#[derive(Debug, Display, Clone, Error)]
56#[display("path is too long")]
57pub struct PathLengthError;
58
59#[derive(Debug, Display, Clone, Error)]
60#[display("a component of the provided path does not exist")]
61pub struct MissingComponentError;
62
63#[derive(Debug, Display, Clone, Error)]
64#[display("a component of the provided path is not a directory")]
65pub struct NonDirComponentError;
66
67#[derive(Debug, Display, Clone, Error)]
68#[display("provided string is empty")]
69pub struct EmptyStrError;
70
71#[derive(Debug, Display, Clone, Error)]
72#[display("unable to get home directory")]
73pub struct HomeResolutionError;
74
75#[derive(Debug, Display, Clone, Error)]
76#[display("access to file system component denied")]
77pub struct AccessError;
78
79#[derive(Debug, Display, Clone, Error)]
80#[display("provided path already exists")]
81pub struct AlreadyExistsError;
82
83#[derive(Debug, Display, Clone, Error)]
84#[display("file is too large to open")]
85pub struct OversizedFileError;
86
87#[derive(Debug, Display, Clone, Error)]
88#[display("operation was prevented by a file seal or lack or privileges to avoid updating access time")]
89pub struct PermissionError;
90
91#[derive(Debug, Display, Clone, Error)]
92#[display("write access requested for file on a read-only filesystem")]
93pub struct ReadOnlyFSError;
94
95#[derive(Debug, Display, Clone, Error)]
96#[display("the basename of the provided path is not permitted by the filesystem")]
97pub struct InvalidBasenameError;
98
99#[derive(Debug, Display, Clone, Error)]
100#[display("write access was requested on a file that is currently being executed or used by the kernel in some way")]
101pub struct BusyExecutableError;
102
103#[derive(Debug, Display, Clone, Error)]
104#[display("provided path refers to a file of the wrong type")]
105pub struct IncorrectTypeError;