Struct sway_ir::irtype::Type

source ·
pub struct Type(pub Index);

Tuple Fields§

§0: Index

Implementations§

Get Type if it already exists.

Get the content for this Type.

Get unit type

Get bool type

New unsigned integer type

New u8 type

New u32 type

New u64 type

Get unsigned integer type

Get B256 type

Get string type

Get array type

Get union type

Get struct type

Get pointer type

Return a string representation of type, used for printing.

Compare a type to this one for equivalence. PartialEq does not take into account the special case for Unions below.

Is bool type

Is unit type

Is unsigned integer type

Is u8 type

Is u32 type

Is u64 type

Is unsigned integer type of specific width

Is B256 type

Is string type

Is array type

Is union type

Is struct type

Returns true if this is a slice type.

Get width of an integer type.

What’s the type of the struct value indexed by indices.

Get the type of the array element, if applicable.

Get the length of the array , if applicable.

Get the length of a string

Get the type of each field of a struct Type. Empty vector otherwise.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. 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 tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.