[][src]Enum llhd::TypeKind

pub enum TypeKind {
    VoidType,
    TimeType,
    IntType(usize),
    EnumType(usize),
    PointerType(Type),
    SignalType(Type),
    ArrayType(usizeType),
    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$.

ArrayType(usizeType)

Array 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]

pub fn unwrap_int(&self) -> usize[src]

Unwrap the type to its integer bit width, or panic if the type is not an integer.

pub fn unwrap_enum(&self) -> usize[src]

Unwrap the type to its number of enumerated states, or panic if the type is not an enum.

pub fn unwrap_pointer(&self) -> &Type[src]

Unwrap the type to its pointer data type, or panic if the type is not a pointer. E.g. yields the i8 type in i8*.

pub fn unwrap_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$.

pub fn unwrap_array(&self) -> (usize, &Type)[src]

Unwrap the type to its array length and element type, or panic if the type is not an array. E.g. yields the (16, i32) in [16 x i32].

pub fn unwrap_struct(&self) -> &[Type][src]

Unwrap the type to its struct fields, or panic if the type is not a struct. E.g. yields the [i8, i16] in {i8, i16}.

pub fn unwrap_func(&self) -> (&[Type], &Type)[src]

Unwrap the type into arguments and return type, or panic if the type is not a function.

pub fn unwrap_entity(&self) -> (&[Type], &[Type])[src]

Unwrap the type into input and output arguments, or panic if the type is not an entity.

pub fn is_void(&self) -> bool[src]

Check if this is a void type.

pub fn is_time(&self) -> bool[src]

Check if this is a time type.

pub fn is_int(&self) -> bool[src]

Check if this is an integer type.

pub fn is_enum(&self) -> bool[src]

Check if this is an enum type.

pub fn is_pointer(&self) -> bool[src]

Check if this is a pointer type.

pub fn is_signal(&self) -> bool[src]

Check if this is a signal type.

pub fn is_array(&self) -> bool[src]

Check if this is an array type.

pub fn is_struct(&self) -> bool[src]

Check if this is a struct type.

pub fn is_func(&self) -> bool[src]

Check if this is a func type.

pub fn is_entity(&self) -> bool[src]

Check if this is an entity type.

Trait Implementations

impl PartialEq<TypeKind> for TypeKind[src]

impl Eq for TypeKind[src]

impl Display for TypeKind[src]

impl Debug for TypeKind[src]

Auto Trait Implementations

impl Send for TypeKind

impl Sync for TypeKind

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]