[][src]Enum llhd::TypeKind

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

VectorType(usizeType)

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]

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

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

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

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

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

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

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

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

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

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

Check if this type is a void type.

Trait Implementations

impl Eq for TypeKind
[src]

impl PartialEq<TypeKind> for TypeKind
[src]

impl Debug for TypeKind
[src]

impl Display for TypeKind
[src]

Auto Trait Implementations

impl Send for TypeKind

impl Sync for TypeKind

Blanket Implementations

impl<T> From for T
[src]

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

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

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, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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