Skip to main content

Directory

Struct Directory 

Source
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: Metadata

Metadata for this directory (name, path, cluster, timestamps, etc.).

Implementations§

Source§

impl Directory

Source

pub fn contains(&self, name: &str) -> Result<bool>

Returns true if an entry called “name” is contained in this directory

Source

pub fn create_file(&mut self, name: String) -> Result<File>

Create a new file in this directory

Source

pub fn create_directory(&mut self, name: String) -> Result<Directory>

Create a new directory in this directory

Source

pub fn delete(&mut self, target_name: String) -> Result<()>

Delete the entry named target_name from this directory.

Source

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.

Source

pub fn contents(&self) -> Result<Vec<DirectoryEntry>>

Returns all entries (files and subdirectories) contained in this directory.

Source

pub fn rename( &mut self, target_name: String, destination_path: PathBuf, ) -> Result<()>

Rename or move target_name to destination_path.

Trait Implementations§

Source§

impl Debug for Directory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Directory> for DirectoryEntry

Source§

fn from(directory: Directory) -> Self

Converts to this type from the input type.
Source§

impl VfatMetadataTrait for Directory

Source§

fn metadata(&self) -> &Metadata

Returns a reference to the entry’s Metadata.
Source§

fn name(&self) -> &str

Returns the entry’s name.
Source§

fn creation(&self) -> VfatTimestamp

Returns the entry’s creation timestamp.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.