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) -> TypeInfo
pub fn signed_int(size: u64) -> TypeInfo
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<TypeInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypeInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TypeInfo
impl Serialize for TypeInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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