pub struct Directory {
pub name: Arc<String>,
pub files: Vec<FileEntry>,
pub subdirs: Vec<Directory>,
pub unique_id: u64,
pub udf_icb_location: u32,
pub iso_extent: FileExtent,
}Expand description
A directory in the file tree
Fields§
§name: Arc<String>Directory name (empty for root)
files: Vec<FileEntry>Files in this directory
subdirs: Vec<Directory>Subdirectories
unique_id: u64Unique ID for this directory (used by UDF)
udf_icb_location: u32ICB location for UDF (logical block within partition)
iso_extent: FileExtentDirectory extent for ISO (sector and size)
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn add_subdir(&mut self, dir: Directory)
pub fn add_subdir(&mut self, dir: Directory)
Add a subdirectory
Sourcepub fn find_file(&self, name: &str) -> Option<&FileEntry>
pub fn find_file(&self, name: &str) -> Option<&FileEntry>
Find a file by name in this directory (not recursive)
Sourcepub fn find_file_mut(&mut self, name: &str) -> Option<&mut FileEntry>
pub fn find_file_mut(&mut self, name: &str) -> Option<&mut FileEntry>
Find a file by name in this directory (not recursive, mutable)
Sourcepub fn find_subdir(&self, name: &str) -> Option<&Directory>
pub fn find_subdir(&self, name: &str) -> Option<&Directory>
Find a subdirectory by name
Sourcepub fn find_subdir_mut(&mut self, name: &str) -> Option<&mut Directory>
pub fn find_subdir_mut(&mut self, name: &str) -> Option<&mut Directory>
Find a subdirectory by name (mutable)
Sourcepub fn total_files(&self) -> usize
pub fn total_files(&self) -> usize
Get the total number of files (recursive)
Sourcepub fn total_dirs(&self) -> usize
pub fn total_dirs(&self) -> usize
Get the total number of directories (recursive, including self)
Sourcepub fn iter_files(&self) -> Vec<&FileEntry>
pub fn iter_files(&self) -> Vec<&FileEntry>
Iterate over all files recursively
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnsafeUnpin for Directory
impl UnwindSafe for Directory
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