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.
pub fn alignment(&self) -> usize
Trait Implementations§
Source§impl From<&Structure> for StructureBuilder
impl From<&Structure> for StructureBuilder
Source§fn from(structure: &Structure) -> StructureBuilder
fn from(structure: &Structure) -> StructureBuilder
Source§impl ToOwned for Structure
impl ToOwned for Structure
impl Eq for Structure
impl StructuralPartialEq for Structure
Auto Trait Implementations§
impl Freeze for Structure
impl RefUnwindSafe for Structure
impl !Send for Structure
impl !Sync for Structure
impl Unpin for Structure
impl UnwindSafe for Structure
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more