pub struct Document {Show 26 fields
pub file_guid: [u8; 16],
pub root_type: String,
pub data_start: usize,
pub data_end: usize,
pub arrays_offset: u32,
pub boxed_values_offset: u32,
pub strings_offset: u32,
pub serialized_layout: bool,
pub hashed_reflection_names: bool,
pub reflection_data: Vec<u8>,
pub fixup_type_guids: Vec<[u8; 16]>,
pub fixup_type_signatures: Vec<u32>,
pub boxed_reference_offsets: Vec<u32>,
pub types: Vec<TypeDescriptor>,
pub fields: Vec<FieldDescriptor>,
pub instances: Vec<Instance>,
pub imports: Vec<ImportReference>,
pub arrays: Vec<ArrayRecord>,
pub boxed_values: Vec<BoxedValueRecord>,
pub pointer_offsets: Vec<u32>,
pub resource_ref_offsets: Vec<u32>,
pub import_offsets: Vec<u32>,
pub type_info_offsets: Vec<u32>,
pub boxed_value_slots: Vec<u32>,
pub payload: Vec<u8>,
pub reflection_groups: Vec<ReflectionGroup>,
}Expand description
Fields§
§file_guid: [u8; 16]The document’s own GUID (the first 16 bytes of the EFIX chunk); other documents import it by this.
root_type: StringName of the first instance’s type.
data_start: usizeAbsolute offsets of the EBXD payload in the bytes read.
data_end: usizeAbsolute offset of the end of the EBXD payload in the bytes read.
arrays_offset: u32Offset of the EBXX array section, from the start of the payload (EFIX).
boxed_values_offset: u32Offset of the boxed-value section, from the start of the payload (EFIX).
strings_offset: u32Offset of the string section, from the start of the payload (EFIX).
serialized_layout: boolWhether the RIFF form is EBXS rather than EBX.
hashed_reflection_names: boolWhether the reflection chunk is RFL2 (names looked up by hash) rather than REFL.
reflection_data: Vec<u8>The reflection chunk (REFL or RFL2) as stored.
fixup_type_guids: Vec<[u8; 16]>The GUIDs of the types the instances use (EFIX), indexed by Instance::fixup_type.
fixup_type_signatures: Vec<u32>The signatures that go with fixup_type_guids; there may be fewer than GUIDs.
boxed_reference_offsets: Vec<u32>The offsets of boxed-value references (EFIX), if the chunk carries them.
types: Vec<TypeDescriptor>The reflected types.
fields: Vec<FieldDescriptor>The reflected fields; each type owns a run of them.
instances: Vec<Instance>The instances in EFIX order, the exported ones first.
imports: Vec<ImportReference>The documents this one imports from.
arrays: Vec<ArrayRecord>The EBXX array records.
boxed_values: Vec<BoxedValueRecord>The EBXX boxed-value records, sorted by offset.
pointer_offsets: Vec<u32>Payload offsets of the pointer fields (EFIX).
resource_ref_offsets: Vec<u32>Payload offsets of the resource-reference fields (EFIX).
import_offsets: Vec<u32>Payload offsets of the import pointers (EFIX).
type_info_offsets: Vec<u32>Payload offsets of the type-reference fields (EFIX).
boxed_value_slots: Vec<u32>Payload offsets of the boxed-value fields found while reading values.
payload: Vec<u8>The EBXD bytes as read (from data_start): what boxed values point at is carried from here.
reflection_groups: Vec<ReflectionGroup>The RFL2 array-type groups.
Implementations§
Source§impl Document
impl Document
Sourcepub fn fixup_type_target(&self, slot: usize) -> Option<usize>
pub fn fixup_type_target(&self, slot: usize) -> Option<usize>
The reflected type (Document::types index) the EFIX type list’s slot names, by GUID and signature (the
GUID alone when the list has no signature for the slot); None when the slot is past the list or the document
reflects no such type (the list names GUIDs the reflection table lacks).
Sourcepub fn type_ref_target(&self, t: &TypeRef) -> Option<usize>
pub fn type_ref_target(&self, t: &TypeRef) -> Option<usize>
The reflected type (Document::types index) a type reference names; None for an empty or primitive
reference and for one whose EFIX slot reflects no type.
Sourcepub fn enum_members(
&self,
field: usize,
) -> impl Iterator<Item = (&str, i64)> + '_
pub fn enum_members( &self, field: usize, ) -> impl Iterator<Item = (&str, i64)> + '_
The members of the enumeration field (an index into Document::fields, FieldValue::descriptor) declares: each
member’s name and value. The reflection table lists an enumeration as a type whose fields are its members, the value
of a member being the field’s data_offset read as a signed 32-bit number. Empty for a field that is not an
enumeration and for an enumeration with no members.
Sourcepub fn enum_member(&self, field: usize, value: i64) -> Option<&str>
pub fn enum_member(&self, field: usize, value: i64) -> Option<&str>
The name of the member of the enumeration field (Document::enum_members) that has value; None when the
field is not an enumeration or no member has the value (one stock value, of 3,368,510, names no member).
Sourcepub fn array_data_offset(&self, slot: u32) -> Option<u32>
pub fn array_data_offset(&self, slot: u32) -> Option<u32>
Where the elements of the array whose 4-byte slot lies at payload offset slot start (payload offsets, as
Instance::data_offset): the slot holds a displacement from itself to the first element, the count lying just
before it. None when the slot or the target lies outside the payload.