Enum TypeLayout
- All Implemented Interfaces:
Serializable,Comparable<TypeLayout>
Canonical ABI type layouts with size and alignment in bytes.
These correspond to the lowered representations of Component Model types in linear memory.
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintReturns the alignment of this type in bytes.intsize()Returns the size of this type in bytes.static TypeLayoutReturns the enum constant of this type with the specified name.static TypeLayout[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BOOL
-
S8
-
U8
-
S16
-
U16
-
S32
-
U32
-
S64
-
U64
-
F32
-
F64
-
STRING
A string is stored as (i32 pointer, i32 byte_length). -
LIST
A list is stored as (i32 pointer, i32 element_count).
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
size
public int size()Returns the size of this type in bytes.- Returns:
- the size in bytes
-
alignment
public int alignment()Returns the alignment of this type in bytes.- Returns:
- the alignment in bytes
-