pub struct Directory {
pub metadata: Metadata,
/* private fields */
}Expand description
A directory is composed of “DirectoryEntry” elements. Every directory has at least two pseudo directories: “.” (current directory) and “..” (parent directory)
Fields§
§metadata: MetadataMetadata for this directory (name, path, cluster, timestamps, etc.).
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn contains(&self, name: &str) -> Result<bool>
pub fn contains(&self, name: &str) -> Result<bool>
Returns true if an entry called “name” is contained in this directory
Sourcepub fn create_file(&mut self, name: String) -> Result<File>
pub fn create_file(&mut self, name: String) -> Result<File>
Create a new file in this directory
Sourcepub fn create_directory(&mut self, name: String) -> Result<Directory>
pub fn create_directory(&mut self, name: String) -> Result<Directory>
Create a new directory in this directory
Sourcepub fn delete(&mut self, target_name: String) -> Result<()>
pub fn delete(&mut self, target_name: String) -> Result<()>
Delete the entry named target_name from this directory.
Sourcepub fn raw_entry_count(&self) -> Result<usize>
pub fn raw_entry_count(&self) -> Result<usize>
Returns the total number of raw directory entry slots in use (regular, LFN, and deleted — everything except end-of-entries markers). Useful for verifying that deleted slots are being reclaimed.
Sourcepub fn contents(&self) -> Result<Vec<DirectoryEntry>>
pub fn contents(&self) -> Result<Vec<DirectoryEntry>>
Returns all entries (files and subdirectories) contained in this directory.
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