pub struct VersionInfo<'a> { /* private fields */ }Expand description
Version Information.
Implementations§
Source§impl<'a> VersionInfo<'a>
impl<'a> VersionInfo<'a>
pub fn try_from(bytes: &'a [u8]) -> Result<VersionInfo<'a>>
Sourcepub fn fixed(self) -> Option<&'a VS_FIXEDFILEINFO>
pub fn fixed(self) -> Option<&'a VS_FIXEDFILEINFO>
Gets the fixed file information if available.
Queries \.
Sourcepub fn translation(self) -> &'a [Language]
pub fn translation(self) -> &'a [Language]
Gets the available languages.
Queries \VarFileInfo\Translation.
Sourcepub fn value(self, lang: Language, key: &str) -> Option<String>
pub fn value(self, lang: Language, key: &str) -> Option<String>
Gets a string value by name.
Queries \StringFileInfo\{lang}\{key}
Sourcepub fn strings<F: FnMut(&str, &str)>(self, lang: Language, f: F)
pub fn strings<F: FnMut(&str, &str)>(self, lang: Language, f: F)
Iterates over all the strings’ keys and values of a given language.
Queries \StringFileInfo\{lang}\*
Sourcepub fn source_code(self) -> String
pub fn source_code(self) -> String
Renders the version info back into its source code form.
Sourcepub fn visit(self, visit: &mut dyn Visit<'a>)
pub fn visit(self, visit: &mut dyn Visit<'a>)
Parse the version information.
Because of the super convoluted format, the visitor pattern is used.
Implement the Visit trait to get the desired information.
To keep the API simple all errors are ignored, any invalid or corrupted data is skipped.
Trait Implementations§
Source§impl<'a> Clone for VersionInfo<'a>
impl<'a> Clone for VersionInfo<'a>
Source§fn clone(&self) -> VersionInfo<'a>
fn clone(&self) -> VersionInfo<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VersionInfo<'_>
impl Debug for VersionInfo<'_>
impl<'a> Copy for VersionInfo<'a>
Auto Trait Implementations§
impl<'a> Freeze for VersionInfo<'a>
impl<'a> RefUnwindSafe for VersionInfo<'a>
impl<'a> Send for VersionInfo<'a>
impl<'a> Sync for VersionInfo<'a>
impl<'a> Unpin for VersionInfo<'a>
impl<'a> UnwindSafe for VersionInfo<'a>
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