pub enum Type {
Unit,
Bool,
Uint(u8),
B256,
String(u64),
Array(Aggregate),
Union(Aggregate),
Struct(Aggregate),
Pointer(Pointer),
Slice,
}
Variants§
Unit
Bool
Uint(u8)
B256
String(u64)
Array(Aggregate)
Union(Aggregate)
Struct(Aggregate)
Pointer(Pointer)
Slice
Implementations§
source§impl Type
impl Type
sourcepub fn is_copy_type(&self) -> bool
pub fn is_copy_type(&self) -> bool
Return whether this is a ‘copy’ type, one whose value will always fit in a register.
sourcepub fn as_string(&self, context: &Context) -> String
pub fn as_string(&self, context: &Context) -> String
Return a string representation of type, used for printing.
sourcepub fn eq(&self, context: &Context, other: &Type) -> bool
pub fn eq(&self, context: &Context, other: &Type) -> bool
Compare a type to this one for equivalence. We’re unable to use PartialEq
as we need the
Context
to compare structs and arrays.
pub fn strip_ptr_type(&self, context: &Context) -> Type
sourcepub fn get_inner_ptr_type(&self, context: &Context) -> Option<Type>
pub fn get_inner_ptr_type(&self, context: &Context) -> Option<Type>
Gets the inner pointer type if its a pointer.
sourcepub fn is_ptr_type(&self) -> bool
pub fn is_ptr_type(&self) -> bool
Returns true if this is a pointer type.