pub trait VfsNode:
Send
+ Sync
+ Any {
// Required methods
fn id(&self) -> u64;
fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>;
fn metadata(&self) -> Result<FileMetadata, FileSystemError>;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn file_type(&self) -> Result<FileType, FileSystemError> { ... }
fn is_directory(&self) -> Result<bool, FileSystemError> { ... }
fn is_symlink(&self) -> Result<bool, FileSystemError> { ... }
fn read_link(&self) -> Result<String, FileSystemError> { ... }
}
Expand description
VfsNode trait represents the “entity” interface for files and directories
This trait provides only basic APIs for file/directory attributes, type checks, fs reference, and downcasting. All operation APIs (lookup, create, remove, open, etc.) are consolidated in FileSystemOperations for clear separation of concerns.
Required Methods§
Sourcefn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>
Returns a (Weak) reference to the filesystem this node belongs to
Sourcefn metadata(&self) -> Result<FileMetadata, FileSystemError>
fn metadata(&self) -> Result<FileMetadata, FileSystemError>
Get metadata for this node
Provided Methods§
Sourcefn file_type(&self) -> Result<FileType, FileSystemError>
fn file_type(&self) -> Result<FileType, FileSystemError>
Get the file type of this node
Sourcefn is_directory(&self) -> Result<bool, FileSystemError>
fn is_directory(&self) -> Result<bool, FileSystemError>
Returns true if this node is a directory
Sourcefn is_symlink(&self) -> Result<bool, FileSystemError>
fn is_symlink(&self) -> Result<bool, FileSystemError>
Returns true if this node is a symbolic link
Sourcefn 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)