pub enum TypeInfo {
BaseType {
name: String,
size: u64,
encoding: u16,
},
PointerType {
target_type: Box<TypeInfo>,
size: u64,
},
ArrayType {
element_type: Box<TypeInfo>,
element_count: Option<u64>,
total_size: Option<u64>,
},
StructType {
name: String,
size: u64,
members: Vec<StructMember>,
},
UnionType {
name: String,
size: u64,
members: Vec<StructMember>,
},
EnumType {
name: String,
size: u64,
base_type: Box<TypeInfo>,
variants: Vec<EnumVariant>,
},
TypedefType {
name: String,
underlying_type: Box<TypeInfo>,
},
QualifiedType {
qualifier: TypeQualifier,
underlying_type: Box<TypeInfo>,
},
FunctionType {
return_type: Option<Box<TypeInfo>>,
parameters: Vec<TypeInfo>,
},
BitfieldType {
underlying_type: Box<TypeInfo>,
bit_offset: u8,
bit_size: u8,
},
UnknownType {
name: String,
},
OptimizedOut {
name: String,
},
}Expand description
Type information with full fidelity from DWARF debugging data
Variants§
BaseType
Base/primitive type (int, float, char, etc.)
PointerType
Pointer type
ArrayType
Array type
StructType
Struct/class type
UnionType
Union type
EnumType
Enum type
TypedefType
Typedef (type alias)
QualifiedType
Qualified type (const, volatile, restrict)
FunctionType
Function type
BitfieldType
Bitfield type: a view over an underlying integer type with bit offset/size
UnknownType
Unresolved or unknown type
OptimizedOut
Optimized out type (variable was optimized away by compiler)
Implementations§
Source§impl TypeInfo
impl TypeInfo
Sourcepub fn is_signed_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
Check if this is a signed integer type
Sourcepub fn is_unsigned_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
Check if this is an unsigned integer type
Sourcepub fn is_pointer(&self) -> bool
pub fn is_pointer(&self) -> bool
Check if this is a pointer type
Sourcepub fn underlying_type(&self) -> &TypeInfo
pub fn underlying_type(&self) -> &TypeInfo
Get the underlying type, skipping typedefs and qualifiers
Sourcepub fn signed_int(size: u64) -> Self
pub fn signed_int(size: u64) -> Self
Create a signed integer base type (compatibility method for compiler)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeInfo
impl<'de> Deserialize<'de> for TypeInfo
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
impl StructuralPartialEq for TypeInfo
Auto Trait Implementations§
impl Freeze for TypeInfo
impl RefUnwindSafe for TypeInfo
impl Send for TypeInfo
impl Sync for TypeInfo
impl Unpin for TypeInfo
impl UnwindSafe for TypeInfo
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