pub struct Inode(/* private fields */);
Expand description
Type-safe wrapper for inode numbers.
An inode (index node) is a unique identifier for file system objects such as files, directories, symbolic links, and other entities within a file system. Each file system object has a unique inode number that persists for the lifetime of the object.
§Examples
use file_system::Inode_type;
// Create an inode number
let inode = Inode_type::new(42);
assert_eq!(inode.As_u64(), 42);
// Inode numbers can be compared
let another_inode = Inode_type::new(43);
assert!(inode < another_inode);
// Arithmetic operations are supported
let incremented = inode + 10;
assert_eq!(incremented.As_u64(), 52);
§Note
Inode 0 is typically reserved in most file systems. The minimum valid
inode number is provided as Inode::MINIMUM
.
Implementations§
Trait Implementations§
Source§impl AddAssign<u64> for Inode
impl AddAssign<u64> for Inode
Source§fn add_assign(&mut self, other: u64)
fn add_assign(&mut self, other: u64)
Performs the
+=
operation. Read moreSource§impl Ord for Inode
impl Ord for Inode
Source§impl PartialOrd for Inode
impl PartialOrd for Inode
impl Copy for Inode
impl Eq for Inode
impl StructuralPartialEq for Inode
Auto Trait Implementations§
impl Freeze for Inode
impl RefUnwindSafe for Inode
impl Send for Inode
impl Sync for Inode
impl Unpin for Inode
impl UnwindSafe for Inode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more