Enum llhd::ty::TypeKind[][src]

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>),
}
Expand description

The different kinds of types.

Variants

VoidType

The void type.

TimeType

The time type.

IntType(usize)

Integer types like i32.

Tuple Fields of IntType

0: usize
EnumType(usize)

Enumerated types like n42.

Tuple Fields of EnumType

0: usize
PointerType(Type)

Pointer types like i32*.

Tuple Fields of PointerType

0: Type
SignalType(Type)

Signal types like i32$.

Tuple Fields of SignalType

0: Type
ArrayType(usizeType)

Array types like [4 x i32].

Tuple Fields of ArrayType

0: usize1: Type
StructType(Vec<Type>)

Struct types like {i8, i32}.

Tuple Fields of StructType

0: Vec<Type>
FuncType(Vec<Type>, Type)

Function types like (i32) void.

Tuple Fields of FuncType

0: Vec<Type>1: Type
EntityType(Vec<Type>, Vec<Type>)

Entity types like (i8, i8; i32).

Tuple Fields of EntityType

0: Vec<Type>1: Vec<Type>

Implementations

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

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

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*.

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

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

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}.

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

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

Check if this is a void type.

Check if this is a time type.

Check if this is an integer type.

Check if this is an enum type.

Check if this is a pointer type.

Check if this is a signal type.

Check if this is an array type.

Check if this is a struct type.

Check if this is a func type.

Check if this is an entity type.

Extract the length of the type.

This is the number of:

  • bits in an integer
  • states in an enum
  • elements in an array
  • fields in a struct

Returns zero for all other types.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.