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(TypeId, Span),
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(TypeId, usize, TypeId),
Storage {
fields: Vec<TypedStructField>,
},
}Expand description
Type information without an associated value, used for type inferencing and definition.
Variants
Unknown
UnknownGeneric
Fields
name: IdentStr(u64)
UnsignedInteger(IntegerBits)
Enum
Struct
Boolean
Ref(TypeId, Span)
For the type inference engine to use when a type references another type
Tuple(Vec<TypeArgument>)
ContractCaller
Represents a type which contains methods to issue a contract call.
The specific contract is identified via the Ident within.
Custom
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(TypeId, usize, TypeId)
Storage
Fields
fields: Vec<TypedStructField>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
sourceimpl TypeInfo
impl TypeInfo
pub fn json_abi_str(&self) -> String
pub fn is_uninhabited(&self) -> bool
pub fn is_zero_sized(&self) -> bool
pub fn is_unit(&self) -> bool
pub fn is_copy_type(&self) -> bool
Trait Implementations
sourceimpl PartialEq<TypeInfo> for TypeInfo
impl PartialEq<TypeInfo> for TypeInfo
impl Eq for TypeInfo
Auto Trait Implementations
impl RefUnwindSafe for TypeInfo
impl Send for TypeInfo
impl Sync for TypeInfo
impl Unpin for TypeInfo
impl UnwindSafe for TypeInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more