pub enum TypeInfo {
Show 19 variants
Unknown,
UnknownGeneric {
name: Ident,
},
Str(u64),
UnsignedInteger(IntegerBits),
Enum {
name: Ident,
variant_types: Vec<TypedEnumVariant>,
},
Struct {
name: Ident,
fields: Vec<TypedStructField>,
},
Boolean,
Ref(TypeId),
Tuple(Vec<TypeArgument>),
ContractCaller {
abi_name: AbiName,
address: String,
},
Custom {
name: Ident,
type_arguments: Vec<TypeArgument>,
},
SelfType,
Byte,
B256,
Numeric,
Contract,
ErrorRecovery,
Array(TypeId, usize),
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)
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)
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 pair_as_str_to_type_info(
input: Pair<Rule>,
config: Option<&BuildConfig>
) -> CompileResult<Self>
pub fn is_uninhabited(&self) -> bool
pub fn is_zero_sized(&self) -> bool
pub fn is_unit(&self) -> bool
Trait Implementations
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more