pub struct FileVersionInfo { /* private fields */ }Expand description
All translations of a PE file’s VS_VERSIONINFO resource plus the
file-global FixedFileInfo.
Implementations§
Source§impl FileVersionInfo
impl FileVersionInfo
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Read and parse every \StringFileInfo\<lang-codepage>\ block plus
the root VS_FIXEDFILEINFO. Wraps GetFileVersionInfoSizeW +
GetFileVersionInfoW + VerQueryValueW.
Sourcepub fn for_translation(
&self,
translation: Translation,
) -> Option<&FileInformation>
pub fn for_translation( &self, translation: Translation, ) -> Option<&FileInformation>
Look up the entry for translation.
Tries looking up the provided translation in the translations set first.
If that fails, in order, it goes for:
- System default, if available;
- English, if available;
- The first available translation, if any.
§Arguments
translation: The language to seek out the file version information for. Combine withTranslation::defaultfor English orTranslation::from_systemfor the system UI language.
Sourcepub fn english(&self) -> Option<&FileInformation>
pub fn english(&self) -> Option<&FileInformation>
Shortcut for for_translation with
Translation::default (US English).
Sourcepub fn system(&self) -> Option<&FileInformation>
pub fn system(&self) -> Option<&FileInformation>
Shortcut for for_translation with
Translation::from_system (the user’s UI language).
Sourcepub const fn all(&self) -> &HashMap<Translation, FileInformation>
pub const fn all(&self) -> &HashMap<Translation, FileInformation>
All loaded translations.
Sourcepub const fn fixed(&self) -> Option<&FixedFileInfo>
pub const fn fixed(&self) -> Option<&FixedFileInfo>
File-global numeric/flag info from the root VS_FIXEDFILEINFO.
None when the resource omitted it or VerQueryValueW failed.
Auto Trait Implementations§
impl Freeze for FileVersionInfo
impl RefUnwindSafe for FileVersionInfo
impl Send for FileVersionInfo
impl Sync for FileVersionInfo
impl Unpin for FileVersionInfo
impl UnsafeUnpin for FileVersionInfo
impl UnwindSafe for FileVersionInfo
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