pub enum TypeKind {
Show 29 variants
USize {
size: usize,
},
SSize {
size: usize,
},
U64,
U32,
U16,
U8,
S64,
S32,
S16,
S8,
F32,
F64,
LongDouble {
size: usize,
alignment: usize,
},
Char16,
Char32,
WChar {
size: usize,
},
Bool,
Void,
Reference {
size: usize,
referenced_type: Box<TypeKind>,
},
Pointer {
size: usize,
pointee_type: Box<TypeKind>,
},
MemberPointer {
size: usize,
pointee_type: Box<TypeKind>,
record_name: String,
},
Array {
element_type: Box<TypeKind>,
size: Option<usize>,
},
Function {
return_type: Box<TypeKind>,
parameters: Vec<TypeKind>,
},
Struct(StructDecl),
Class(StructDecl),
Union(UnionDecl),
Enum(EnumDecl),
Typedef(Box<Typedef>),
Named(String),
}Variants§
USize
SSize
U64
U32
U16
U8
S64
S32
S16
S8
F32
F64
LongDouble
Char16
Char32
WChar
Bool
Void
Reference
Pointer
MemberPointer
Array
Function
Struct(StructDecl)
Class(StructDecl)
Union(UnionDecl)
Enum(EnumDecl)
Typedef(Box<Typedef>)
Named(String)
Implementations§
Source§impl TypeKind
impl TypeKind
pub fn new(env: &Env, types: &Types, ty: Type<'_>) -> Result<Self, ParseError>
pub fn size(&self, types: &Types) -> usize
pub fn alignment(&self, types: &Types) -> usize
pub fn stride(&self, types: &Types) -> usize
pub fn name(&self) -> Option<&str>
pub fn expand_named<'a>(&'a self, types: &'a Types) -> Option<&'a TypeKind>
pub fn is_forward_decl(&self) -> bool
pub fn as_struct<'a>(&'a self, types: &'a Types) -> Option<&'a StructDecl>
Trait Implementations§
impl Eq for TypeKind
impl StructuralPartialEq for TypeKind
Auto Trait Implementations§
impl Freeze for TypeKind
impl RefUnwindSafe for TypeKind
impl Send for TypeKind
impl Sync for TypeKind
impl Unpin for TypeKind
impl UnsafeUnpin for TypeKind
impl UnwindSafe for TypeKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.