pub enum TypeInfo {
Show 19 variants Unknown, UnknownGeneric { name: Ident, }, Str(u64), UnsignedInteger(IntegerBits), Enum { name: Ident, type_parameters: Vec<TypeParameter>, variant_types: Vec<TypedEnumVariant>, }, Struct { name: Ident, type_parameters: Vec<TypeParameter>, fields: Vec<TypedStructField>, }, Boolean, Ref(TypeIdSpan), Tuple(Vec<TypeArgument>), ContractCaller { abi_name: AbiName, address: Option<Box<TypedExpression>>, }, Custom { name: Ident, type_arguments: Option<Vec<TypeArgument>>, }, SelfType, Byte, B256, Numeric, Contract, ErrorRecovery, Array(TypeIdusizeTypeId), Storage { fields: Vec<TypedStructField>, },
}
Expand description

Type information without an associated value, used for type inferencing and definition.

Variants

Unknown

UnknownGeneric

Fields

name: Ident

Str(u64)

UnsignedInteger(IntegerBits)

Enum

Fields

name: Ident
type_parameters: Vec<TypeParameter>
variant_types: Vec<TypedEnumVariant>

Struct

Fields

name: Ident
type_parameters: Vec<TypeParameter>

Boolean

Ref(TypeIdSpan)

For the type inference engine to use when a type references another type

Tuple(Vec<TypeArgument>)

ContractCaller

Fields

abi_name: AbiName

Represents a type which contains methods to issue a contract call. The specific contract is identified via the Ident within.

Custom

Fields

name: Ident
type_arguments: Option<Vec<TypeArgument>>

A custom type could be a struct or similar if the name is in scope, or just a generic parameter if it is not. At parse time, there is no sense of scope, so this determination is not made until the semantic analysis stage.

SelfType

Byte

B256

Numeric

This means that specific type of a number is not yet known. It will be determined via inference at a later time.

Contract

ErrorRecovery

Array(TypeIdusizeTypeId)

Storage

Fields

Represents the entire storage declaration struct Stored without initializers here, as typed struct fields, so type checking is able to treat it as a struct with fields.

Implementations

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

Returns the “default value” for a type. 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 ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more