pub struct Structure { /* private fields */ }Implementations§
Source§impl Structure
impl Structure
pub fn builder() -> StructureBuilder
pub fn width(&self) -> u64
pub fn structure_type(&self) -> StructureType
Sourcepub fn members_at_offset(
&self,
container: &TypeContainer,
offset: u64,
) -> Vec<StructureMember>
pub fn members_at_offset( &self, container: &TypeContainer, offset: u64, ) -> Vec<StructureMember>
Retrieve the members that are accessible at a given offset.
The reason for this being plural is that members may overlap and the offset is in bytes where a bitfield may contain multiple members at the given byte.
Unions are also represented as structures and will cause this function to return all members that can reach that offset.
We must pass a TypeContainer here so that we can resolve base structure members, as they
are treated as members through this function. Typically, you get the TypeContainer
through the binary view with BinaryViewExt::type_container.
Sourcepub fn members(&self) -> Vec<StructureMember>
pub fn members(&self) -> Vec<StructureMember>
Return the list of non-inherited structure members.
If you want to get all members, including ones inherited from base structures,
use Structure::members_including_inherited instead.
Sourcepub fn members_including_inherited(
&self,
container: &TypeContainer,
) -> Vec<InheritedStructureMember>
pub fn members_including_inherited( &self, container: &TypeContainer, ) -> Vec<InheritedStructureMember>
Returns the list of all structure members, including inherited ones.
Because we must traverse through base structures, we have to provide the TypeContainer;
in most cases it is ok to provide the binary views container via BinaryViewExt::type_container.
Sourcepub fn base_structures(&self) -> Vec<BaseStructure>
pub fn base_structures(&self) -> Vec<BaseStructure>
Retrieve the list of base structures for the structure. These base structures are what give a structure inherited members.