Resources

Struct Resources 

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

Resources filesystem.

Implementations§

Source§

impl<'a> Resources<'a>

Source

pub fn find_resource(&self, path: &[Name<'_>; 2]) -> Result<&'a [u8], FindError>

Finds a resource by its type and name.

Source

pub fn find_resources( &self, path: &[Name<'_>; 2], ) -> Result<Directory<'a>, FindError>

Finds the language directory for a resource with given type and name.

Source

pub fn find_resource_ex( &self, path: &[Name<'_>; 3], ) -> Result<&'a [u8], FindError>

Finds the resource with specified type, name and language.

Source

pub fn version_info(&self) -> Result<VersionInfo<'a>, FindError>

Gets the Version Information.

Source

pub fn manifest(&self) -> Result<&'a str, FindError>

Gets the Application Manifest.

Source

pub fn icons( &self, ) -> impl 'a + Iterator<Item = Result<(Name<'a>, GroupIcon<'a>), FindError>> + Clone

Gets the icons.

Source

pub fn cursors( &self, ) -> impl 'a + Iterator<Item = Result<(Name<'a>, GroupCursor<'a>), FindError>> + Clone

Gets the cursors.

Source§

impl<'a> Resources<'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> Resources<'a>

Source

pub fn new(section: &'a [u8], dir: &'a IMAGE_DATA_DIRECTORY) -> Resources<'a>

Parse the bytes as PE resources.

No validation or integrity checking is done ahead of time.

Source

pub fn root(&self) -> Result<Directory<'a>>

Gets the root directory.

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 Resources<'a>

Source§

fn clone(&self) -> Resources<'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 Resources<'a>

Source§

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

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

impl<'a> Display for Resources<'a>

Source§

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

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

impl<'a> Serialize for Resources<'a>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> Copy for Resources<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Resources<'a>

§

impl<'a> RefUnwindSafe for Resources<'a>

§

impl<'a> Send for Resources<'a>

§

impl<'a> Sync for Resources<'a>

§

impl<'a> Unpin for Resources<'a>

§

impl<'a> UnwindSafe for Resources<'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.