pub struct VarRecord<'a> { /* private fields */ }Expand description
Zero-copy view of a variable-length MSFT_VarRecord.
The base fixed portion is BASE_SIZE (0x14) bytes.
Optional attribute DWORDs follow.
Constructed by VarIter or VarRecord::from_raw.
Implementations§
Source§impl<'a> VarRecord<'a>
impl<'a> VarRecord<'a>
Sourcepub fn from_raw(bytes: &'a [u8]) -> Result<Self, Error>
pub fn from_raw(bytes: &'a [u8]) -> Result<Self, Error>
Creates a VarRecord from an already-sliced byte buffer.
§Errors
Returns Error::TooShort if bytes.len() < BASE_SIZE.
Sourcepub fn info(&self) -> u32
pub fn info(&self) -> u32
Raw Info field.
Low 8 bits = record size in bytes; upper bits = member index.
Sourcepub fn record_size(&self) -> usize
pub fn record_size(&self) -> usize
Record size in bytes (low 16 bits of info).
Sourcepub fn datatype(&self) -> i32
pub fn datatype(&self) -> i32
Variable type (encoded DataType).
Negative values encode simple VT_* types inline.
Non-negative values are offsets into the type descriptor table.
Sourcepub fn vardesc_size(&self) -> i16
pub fn vardesc_size(&self) -> i16
VARDESC size.
Sourcepub fn offs_value(&self) -> i32
pub fn offs_value(&self) -> i32
For VAR_CONST: inline value or offset into the custom data segment.
For VAR_PERINSTANCE: byte offset within the instance.
Sourcepub fn help_context(&self) -> Option<i32>
pub fn help_context(&self) -> Option<i32>
Help context (attribute 0, offset 0x14).
Returns None if the record is too short to contain this field.
Sourcepub fn help_string_offset(&self) -> Option<i32>
pub fn help_string_offset(&self) -> Option<i32>
Help string offset (attribute 1, offset 0x18).
Returns None if the record is too short to contain this field.
Sourcepub fn res9(&self) -> Option<i32>
pub fn res9(&self) -> Option<i32>
Reserved field (attribute 2, offset 0x1C).
Always -1 in practice. Wine identifies this as res9.
Returns None if the record is too short to contain this field.
Sourcepub fn cust_data_offset(&self) -> Option<i32>
pub fn cust_data_offset(&self) -> Option<i32>
Offset into the CDGuids directory for this variable’s custom data (attribute 3, offset 0x20).
Returns None if the record is too short to contain this field.
Sourcepub fn helpstringcontext(&self) -> Option<i32>
pub fn helpstringcontext(&self) -> Option<i32>
Help string context (attribute 4, offset 0x24).
Returns None if the record is too short to contain this field.