Enum move_binary_format::normalized::Type
source · pub enum Type {
Bool,
U8,
U64,
U128,
Address,
Signer,
Struct {
address: AccountAddress,
module: Identifier,
name: Identifier,
type_arguments: Vec<Type>,
},
Vector(Box<Type>),
TypeParameter(TypeParameterIndex),
Reference(Box<Type>),
MutableReference(Box<Type>),
}
Expand description
Defines normalized representations of Move types, fields, kinds, structs, functions, and
modules. These representations are useful in situations that require require comparing
functions, resources, and types across modules. This arises in linking, compatibility checks
(e.g., “is it safe to deploy this new module without updating its dependents and/or restarting
genesis?”), defining schemas for resources stored on-chain, and (possibly in the future)
allowing module updates transactions.
A normalized version of SignatureToken
, a type expression appearing in struct or function
declarations. Unlike SignatureToken
s, normalized::Type
s from different modules can safely be
compared.
Variants§
Bool
U8
U64
U128
Address
Signer
Struct
Vector(Box<Type>)
TypeParameter(TypeParameterIndex)
Reference(Box<Type>)
MutableReference(Box<Type>)
Implementations§
source§impl Type
impl Type
sourcepub fn new(m: &CompiledModule, s: &SignatureToken) -> Self
pub fn new(m: &CompiledModule, s: &SignatureToken) -> Self
Create a normalized Type
for SignatureToken
s
in module m
.
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Return true if self
is a closed type with no free type variables
pub fn into_type_tag(self) -> Option<TypeTag>
pub fn into_struct_tag(self) -> Option<StructTag>
pub fn subst(&self, type_args: &[Type]) -> Self
Trait Implementations§
source§impl Ord for Type
impl Ord for Type
source§impl PartialEq<Type> for Type
impl PartialEq<Type> for Type
source§impl PartialOrd<Type> for Type
impl PartialOrd<Type> for Type
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more