Enum llhd::ty::TypeKind
[−]
[src]
pub enum TypeKind { VoidType, TimeType, IntType(usize), EnumType(usize), PointerType(Type), SignalType(Type), VectorType(usize, Type), StructType(Vec<Type>), FuncType(Vec<Type>, Type), EntityType(Vec<Type>, Vec<Type>), }
The different kinds of types.
Variants
VoidType
The void
type.
TimeType
The time
type.
IntType(usize)
Integer types like i32
.
EnumType(usize)
Enumerated types like n42
.
PointerType(Type)
Pointer types like i32*
.
SignalType(Type)
Signal types like i32$
.
VectorType(usize, Type)
Vector types like <4 x i32>
.
StructType(Vec<Type>)
Struct types like {i8, i32}
.
FuncType(Vec<Type>, Type)
Function types like (i32) void
.
EntityType(Vec<Type>, Vec<Type>)
Entity types like (i8, i8; i32)
.
Methods
impl TypeKind
[src]
fn as_func(&self) -> (&[Type], &Type)
[src]
Unwrap the type into arguments and return type, or panic if the type is not a function.
fn as_entity(&self) -> (&[Type], &[Type])
[src]
Unwrap the type into input and output arguments, or panic if the type is not an entity.
fn as_int(&self) -> usize
[src]
Unwrap the type to its integer bit width, or panic if the type is not an integer.
fn as_enum(&self) -> usize
[src]
Unwrap the type to its number of enumerated states, or panic if the type is not an enum.
fn as_signal(&self) -> &Type
[src]
Unwrap the type to its signal data type, or panic if the type is not an
integer. E.g. yields the i8
type in i8$
.
fn is_void(&self) -> bool
[src]
Check if this type is a void type.
Trait Implementations
impl Debug for TypeKind
[src]
impl PartialEq for TypeKind
[src]
fn eq(&self, __arg_0: &TypeKind) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TypeKind) -> bool
[src]
This method tests for !=
.