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
//! VFS error types.
use thiserror::Error;
/// Result type for VFS operations.
pub type VfsResult<T> = Result<T, VfsError>;
/// Errors that can occur during VFS operations.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum VfsError {
/// File or directory not found.
#[error("not found: {0}")]
NotFound(String),
/// Permission denied.
#[error("permission denied: {0}")]
PermissionDenied(String),
/// File already exists.
#[error("already exists: {0}")]
AlreadyExists(String),
/// Not a directory.
#[error("not a directory: {0}")]
NotDirectory(String),
/// Not a file.
#[error("not a file: {0}")]
NotFile(String),
/// Directory not empty.
#[error("directory not empty: {0}")]
DirectoryNotEmpty(String),
/// Invalid path.
#[error("invalid path: {0}")]
InvalidPath(String),
/// I/O error.
#[error("I/O error: {0}")]
Io(String),
/// Storage backend error.
#[error("storage error: {0}")]
Storage(String),
/// Invalid seek position.
#[error("invalid seek: {0}")]
InvalidSeek(String),
/// Resource busy.
#[error("resource busy: {0}")]
Busy(String),
/// The operation would grow the filesystem past its size limit.
///
/// In-memory storage keeps file contents in host memory, so an unbounded
/// write is an unbounded host allocation. Guests see this as `ENOSPC`
/// (`OSError` in Python), the same as a full disk.
#[error("filesystem full: {0}")]
QuotaExceeded(String),
}