pub struct StructLayout {
pub name: String,
pub total_size: usize,
pub align: usize,
pub fields: Vec<Field>,
pub source_file: Option<String>,
pub source_line: Option<u32>,
pub arch: &'static ArchConfig,
pub is_packed: bool,
pub is_union: bool,
pub is_repr_rust: bool,
}Expand description
One complete struct as read from DWARF or source and enriched by analysis.
Fields§
§name: String§total_size: usize§align: usize§fields: Vec<Field>§source_file: Option<String>§source_line: Option<u32>§arch: &'static ArchConfig§is_packed: bool§is_union: boolTrue when this layout was parsed from a C/C++ union declaration.
All fields share the same base offset (0); analysis suppresses reorder
and padding findings that do not apply to unions.
is_repr_rust: boolTrue when this is a Rust struct with repr(Rust) (i.e. no #[repr(C)],
#[repr(packed)], or #[repr(transparent)]). The compiler is free to
reorder fields and eliminate padding — padlock’s findings describe
declared-order waste, which may not match the actual runtime layout.
Always false for DWARF/binary layouts (which are always accurate).
Trait Implementations§
Source§impl Clone for StructLayout
impl Clone for StructLayout
Source§fn clone(&self) -> StructLayout
fn clone(&self) -> StructLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructLayout
impl Debug for StructLayout
Source§impl<'de> Deserialize<'de> for StructLayout
impl<'de> Deserialize<'de> for StructLayout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StructLayout
impl RefUnwindSafe for StructLayout
impl Send for StructLayout
impl Sync for StructLayout
impl Unpin for StructLayout
impl UnsafeUnpin for StructLayout
impl UnwindSafe for StructLayout
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