pub struct ResourceString<'a> {
pub len: u16,
pub value_len: u16,
pub type: u16,
pub key: &'a [u8],
pub value: &'a [u8],
}Expand description
Represents a resource string entry.
Fields§
§len: u16The length, in bytes, of this ResourceString structure.
value_len: u16The size, in words, of the ResourceString::value.
- When
ResourceString::typeindicates string data: multiply this field with [SIZE_OF_WCHAR] that should be the actual size ofResourceString::valuewith null-terminator. - Othereise, treat as-is.
type: u16The type of ResourceString::value in the version resource.
This member is 1 if the version resource contains text data;
and 0 if the version resource contains binary data, otherwise sometimes an invalid value.
key: &'a [u8]An arbitrary null-terminated utf-16 unicode string.
value: &'a [u8]An arbitrary null-terminated utf-16 unicode string or binary data depends on ResourceString::type.
Implementations§
Source§impl<'a> ResourceString<'a>
impl<'a> ResourceString<'a>
pub fn parse(bytes: &'a [u8], offset: &mut usize) -> Result<Option<Self>>
Sourcepub fn is_text_data(&self) -> bool
pub fn is_text_data(&self) -> bool
Returns true if ResourceString::value is expected to an null-terminated unicode string
Sourcepub fn is_binary_data(&self) -> bool
pub fn is_binary_data(&self) -> bool
Returns true if ResourceString::value is expected to a binary data
Sourcepub fn key_string(&self) -> String
pub fn key_string(&self) -> String
Converts ResourceString::key into a String
Sourcepub fn value_string(&self) -> String
pub fn value_string(&self) -> String
Converts ResourceString::value into a String
Trait Implementations§
Source§impl<'a> Clone for ResourceString<'a>
impl<'a> Clone for ResourceString<'a>
Source§fn clone(&self) -> ResourceString<'a>
fn clone(&self) -> ResourceString<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ResourceString<'a>
Source§impl Debug for ResourceString<'_>
impl Debug for ResourceString<'_>
Source§impl<'a> PartialEq for ResourceString<'a>
impl<'a> PartialEq for ResourceString<'a>
Source§fn eq(&self, other: &ResourceString<'a>) -> bool
fn eq(&self, other: &ResourceString<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for ResourceString<'a>
Auto Trait Implementations§
impl<'a> Freeze for ResourceString<'a>
impl<'a> RefUnwindSafe for ResourceString<'a>
impl<'a> Send for ResourceString<'a>
impl<'a> Sync for ResourceString<'a>
impl<'a> Unpin for ResourceString<'a>
impl<'a> UnsafeUnpin for ResourceString<'a>
impl<'a> UnwindSafe for ResourceString<'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