pub struct Fat32Node {
pub name: RwLock<String>,
pub file_type: RwLock<FileType>,
pub metadata: RwLock<FileMetadata>,
pub children: RwLock<BTreeMap<String, Arc<dyn VfsNode>>>,
pub parent: RwLock<Option<Weak<Fat32Node>>>,
pub filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>,
pub cluster: RwLock<u32>,
pub children_loaded: RwLock<bool>,
}Expand description
FAT32 filesystem node
This structure represents a file or directory in the FAT32 filesystem. It implements the VfsNode trait to integrate with the VFS v2 architecture. Content is read/written directly from/to the block device, not stored in memory.
Fields§
§name: RwLock<String>Node name
file_type: RwLock<FileType>File type (file or directory)
metadata: RwLock<FileMetadata>File metadata
children: RwLock<BTreeMap<String, Arc<dyn VfsNode>>>Child nodes (for directories) - cached, but loaded from disk on demand
parent: RwLock<Option<Weak<Fat32Node>>>Parent node (weak reference to avoid cycles)
filesystem: RwLock<Option<Weak<dyn FileSystemOperations>>>Reference to filesystem
cluster: RwLock<u32>Starting cluster number in FAT32
children_loaded: RwLock<bool>Directory entries loaded flag (for directories)
Implementations§
Source§impl Fat32Node
impl Fat32Node
Sourcepub fn new_file(name: String, file_id: u64, cluster: u32) -> Self
pub fn new_file(name: String, file_id: u64, cluster: u32) -> Self
Create a new regular file node
Sourcepub fn new_directory(name: String, file_id: u64, cluster: u32) -> Self
pub fn new_directory(name: String, file_id: u64, cluster: u32) -> Self
Create a new directory node
Sourcepub fn set_parent(&self, parent: Option<Weak<Fat32Node>>)
pub fn set_parent(&self, parent: Option<Weak<Fat32Node>>)
Set the parent node (weak reference)
Sourcepub fn set_filesystem(&self, filesystem: Weak<dyn FileSystemOperations>)
pub fn set_filesystem(&self, filesystem: Weak<dyn FileSystemOperations>)
Set the filesystem reference
Sourcepub fn set_cluster(&self, cluster: u32)
pub fn set_cluster(&self, cluster: u32)
Set the starting cluster number
Trait Implementations§
Source§impl VfsNode for Fat32Node
impl VfsNode for Fat32Node
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 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
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)
Auto Trait Implementations§
impl !Freeze for Fat32Node
impl !RefUnwindSafe for Fat32Node
impl Send for Fat32Node
impl Sync for Fat32Node
impl Unpin for Fat32Node
impl !UnwindSafe for Fat32Node
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)