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
65
//! Inode number in a FUSE (Filesystem in Userspace) filesystem.
use crateROOT_INO;
/// Represents the mountpoint folder in a FuseFilesystem
/// Its value is 1 and should not be modified.
pub const ROOT_INODE: Inode = from;
/// Represents an inode number in a FUSE (Filesystem in Userspace) filesystem.
///
/// `Inode` implements the `FileIdType` trait, which is used as a generic parameter
/// throughout this crate. This implementation allows `Inode` to be used as a file
/// identifier in various fuse operations.
///
/// For more detailed information about file identification and the `FileIdType` trait,
/// please refer to the documentation of the `FileIdType` trait.
///
/// In FUSE filesystems, inode numbers are unique identifiers for file system objects,
/// distinct from traditional Unix-style inodes. The user of this library is responsible
/// for ensuring the uniqueness of these numbers. Inodes are created for each function
/// that returns an Inode in FuseHandler, and dropped via the forget function of FuseHandler.
/// The lookup function is a special case that increments an internal count (handled inside
/// libfuse) and can create a new inode if it doesn't exist.
///
/// Note: This concept is separate from the traditional Unix inode, which is a data structure
/// describing file system objects like files or directories.
///
/// This struct is a wrapper around a u64, providing type safety and
/// semantic meaning to inode numbers in the FUSE filesystem implementation.
///
/// For users who prefer not to manage inodes directly, this library also supports
/// using `PathBuf` as `FileIdType`. This alternative approach allows for file
/// identification based on paths rather than inode numbers.
;