Directory

Struct Directory 

Source
pub struct Directory<'a> { /* private fields */ }
Expand description

Directory.

Implementations§

Source§

impl<'a> Directory<'a>

Source

pub fn get(&self, name: Name<'_>) -> Result<Entry<'a>, FindError>

Looks up the entry by name.

Source

pub fn get_data(&self, name: Name<'_>) -> Result<DataEntry<'a>, FindError>

Looks up the data entry by name.

Source

pub fn get_dir(&self, name: Name<'_>) -> Result<Directory<'a>, FindError>

Looks up the directory by name.

Source

pub fn first(&self) -> Result<Entry<'a>, FindError>

Gets the first entry.

Source

pub fn first_data(&self) -> Result<DataEntry<'a>, FindError>

Gets the first data entry.

Source

pub fn first_dir(&self) -> Result<Directory<'a>, FindError>

Gets the first directory.

Source§

impl<'a> Directory<'a>

Source

pub fn find<P: AsRef<Path> + ?Sized>( &self, path: &P, ) -> Result<Entry<'a>, FindError>

Finds a file or directory by its path.

Source

pub fn find_data<P: AsRef<Path> + ?Sized>( &self, path: &P, ) -> Result<DataEntry<'a>, FindError>

Finds a file by its path.

Source

pub fn find_dir<P: AsRef<Path> + ?Sized>( &self, path: &P, ) -> Result<Directory<'a>, FindError>

Finds a directory by its path.

Source§

impl<'a> Directory<'a>

Source

pub fn resources(&self) -> Resources<'a>

Gets the resources.

Source

pub fn image(&self) -> &'a IMAGE_RESOURCE_DIRECTORY

Gets the underlying resource directory image.

Source

pub fn entries( &self, ) -> Entries<'a, impl Clone + FnMut(&'a IMAGE_RESOURCE_DIRECTORY_ENTRY) -> DirectoryEntry<'a>>

Gets the directory entries.

Source

pub fn named_entries( &self, ) -> Entries<'a, impl Clone + FnMut(&'a IMAGE_RESOURCE_DIRECTORY_ENTRY) -> DirectoryEntry<'a>>

Gets the named entries in this directory.

Note that while it would be a violation of the format spec, there’s no strict safety guarantee that these are only named entries.

Source

pub fn id_entries( &self, ) -> Entries<'a, impl Clone + FnMut(&'a IMAGE_RESOURCE_DIRECTORY_ENTRY) -> DirectoryEntry<'a>>

Gets the id entries in this directory.

Note that while it would be a violation of the format spec, there’s no strict safety guarantee that these are only id entries.

Source

pub fn fsck(&self) -> Result<()>

Filesystem consistency check.

Simply walks the filesystem checking all references are valid.

Trait Implementations§

Source§

impl<'a> Clone for Directory<'a>

Source§

fn clone(&self) -> Directory<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Directory<'a>

Source§

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

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

impl<'a> Display for Directory<'a>

Source§

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

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

impl<'a> Copy for Directory<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Directory<'a>

§

impl<'a> RefUnwindSafe for Directory<'a>

§

impl<'a> Send for Directory<'a>

§

impl<'a> Sync for Directory<'a>

§

impl<'a> Unpin for Directory<'a>

§

impl<'a> UnwindSafe for Directory<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.