pub enum TypeInfo {
Show 18 variants
Unknown,
UnknownGeneric {
name: Ident,
},
Str(u64),
UnsignedInteger(IntegerBits),
Enum {
name: String,
variant_types: Vec<OwnedTypedEnumVariant>,
},
Struct {
name: String,
fields: Vec<OwnedTypedStructField>,
},
Boolean,
Ref(TypeId),
Tuple(Vec<TypeId>),
ContractCaller {
abi_name: OwnedCallPath,
address: String,
},
Custom {
name: Ident,
},
SelfType,
Byte,
B256,
Numeric,
Contract,
ErrorRecovery,
Array(TypeId, usize),
}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<TypeId>)
ContractCaller
Represents a type which contains methods to issue a contract call.
The specific contract is identified via the Ident within.
Custom
Fields
name: IdentA 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)
Implementations
sourceimpl TypeInfo
impl TypeInfo
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