pub struct Ext2Node {
inode_number: u32,
file_type: FileType,
file_id: u64,
filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>,
}Expand description
ext2 VFS Node
Represents a file or directory in the ext2 filesystem. This node implements the VfsNode trait and provides access to ext2-specific file operations.
Fields§
§inode_number: u32Inode number in the ext2 filesystem
file_type: FileTypeFile type (directory, regular file, etc.)
file_id: u64Unique file ID for VFS
filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>Weak reference to the filesystem
Implementations§
Source§impl Ext2Node
impl Ext2Node
Sourcepub fn new(inode_number: u32, file_type: FileType, file_id: u64) -> Self
pub fn new(inode_number: u32, file_type: FileType, file_id: u64) -> Self
Create a new ext2 node
Sourcepub fn inode_number(&self) -> u32
pub fn inode_number(&self) -> u32
Get the inode number
Sourcepub fn set_filesystem(&self, fs: Weak<dyn FileSystemOperations>)
pub fn set_filesystem(&self, fs: Weak<dyn FileSystemOperations>)
Set the filesystem reference
Sourcepub fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
pub fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
Get the filesystem reference
Trait Implementations§
Source§impl VfsNode for Ext2Node
impl VfsNode for Ext2Node
Source§fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
Returns a (Weak) reference to the filesystem this node belongs to
Source§fn file_type(&self) -> Result<FileType, FileSystemError>
fn file_type(&self) -> Result<FileType, FileSystemError>
Get the file type of this node
Source§fn metadata(&self) -> Result<FileMetadata, FileSystemError>
fn metadata(&self) -> Result<FileMetadata, FileSystemError>
Get metadata for this node
Source§fn read_link(&self) -> Result<String, FileSystemError>
fn read_link(&self) -> Result<String, FileSystemError>
Read the target of a symbolic link (returns error if not a symlink)
Source§fn is_directory(&self) -> Result<bool, FileSystemError>
fn is_directory(&self) -> Result<bool, FileSystemError>
Returns true if this node is a directory
Source§fn is_symlink(&self) -> Result<bool, FileSystemError>
fn is_symlink(&self) -> Result<bool, FileSystemError>
Returns true if this node is a symbolic link