Struct bytecode_interpreter::concrete::value::TypedValue
source · pub struct TypedValue { /* private fields */ }
Implementations§
source§impl TypedValue
impl TypedValue
pub fn fuse_base(ty: BaseType, val: BaseValue) -> Self
pub fn mk_bool(v: bool) -> Self
pub fn mk_u8(v: u8) -> Self
pub fn mk_u64(v: u64) -> Self
pub fn mk_u128(v: u128) -> Self
pub fn mk_num(v: BigInt) -> Self
pub fn mk_address(v: AccountAddress) -> Self
pub fn mk_signer(v: AccountAddress) -> Self
pub fn mk_vector(elem: BaseType, v: Vec<TypedValue>) -> Self
pub fn mk_struct(inst: StructInstantiation, v: Vec<TypedValue>) -> Self
pub fn mk_ref_bool(v: bool, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_u8(v: u8, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_u64(v: u64, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_u128(v: u128, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_num(v: BigInt, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_address(v: AccountAddress, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_signer(v: AccountAddress, is_mut: bool, ptr: Pointer) -> Self
pub fn mk_ref_vector( elem: BaseType, v: Vec<TypedValue>, is_mut: bool, ptr: Pointer ) -> Self
pub fn mk_ref_struct( inst: StructInstantiation, v: Vec<TypedValue>, is_mut: bool, ptr: Pointer ) -> Self
pub fn into_bool(self) -> bool
pub fn into_u8(self) -> u8
pub fn into_u64(self) -> u64
pub fn into_u128(self) -> u128
pub fn into_num(self) -> BigInt
pub fn into_int(self) -> BigInt
pub fn into_address(self) -> AccountAddress
pub fn into_signer(self) -> AccountAddress
pub fn into_vector(self) -> Vec<BaseValue> ⓘ
pub fn into_struct(self) -> Vec<BaseValue> ⓘ
pub fn into_ref_bool(self) -> (bool, bool, Pointer)
pub fn into_ref_u8(self) -> (u8, bool, Pointer)
pub fn into_ref_u64(self) -> (u64, bool, Pointer)
pub fn into_ref_u128(self) -> (u128, bool, Pointer)
pub fn into_ref_num(self) -> (BigInt, bool, Pointer)
pub fn into_ref_address(self) -> (AccountAddress, bool, Pointer)
pub fn into_ref_signer(self) -> (AccountAddress, bool, Pointer)
pub fn into_ref_vector(self) -> (Vec<BaseValue>, bool, Pointer)
pub fn into_ref_struct(self) -> (Vec<BaseValue>, bool, Pointer)
pub fn get_ty(&self) -> &Type
pub fn get_val(&self) -> &BaseValue
pub fn get_ptr(&self) -> &Pointer
pub fn decompose(self) -> (Type, BaseValue, Pointer)
sourcepub fn assign_cast(self, ty: Type) -> TypedValue
pub fn assign_cast(self, ty: Type) -> TypedValue
Cast this value into a compatible type. Cast ty
must be compatible
sourcepub fn borrow_local(self, is_mut: bool, local_idx: TempIndex) -> TypedValue
pub fn borrow_local(self, is_mut: bool, local_idx: TempIndex) -> TypedValue
Create a reference to the base value
sourcepub fn read_ref(self) -> TypedValue
pub fn read_ref(self) -> TypedValue
Read the reference and create a base value
sourcepub fn write_ref(self, ptr: Pointer) -> TypedValue
pub fn write_ref(self, ptr: Pointer) -> TypedValue
Create a mutable reference to this base value
sourcepub fn freeze_ref(self) -> TypedValue
pub fn freeze_ref(self) -> TypedValue
Convert the mutable reference into immutable
sourcepub fn box_into_mut_ref_arg(self, index: TempIndex) -> TypedValue
pub fn box_into_mut_ref_arg(self, index: TempIndex) -> TypedValue
Wrap the pointer in the mutable reference to mark that this ref is passed in as an argument
sourcepub fn unbox_from_mut_ref_arg(self) -> TypedValue
pub fn unbox_from_mut_ref_arg(self) -> TypedValue
Unwrap the pointer from the mutable reference to its original pointer
sourcepub fn box_into_mut_ref_ret(
self,
ptrs: &BTreeMap<TempIndex, &Pointer>
) -> TypedValue
pub fn box_into_mut_ref_ret( self, ptrs: &BTreeMap<TempIndex, &Pointer> ) -> TypedValue
Wrap the pointer in the mutable reference to mark that this ref is passed out as a return
sourcepub fn unbox_from_mut_ref_ret(self) -> TypedValue
pub fn unbox_from_mut_ref_ret(self) -> TypedValue
Unwrap the pointer from the mutable reference to its original pointer
sourcepub fn get_vector_element(self, elem_num: usize) -> Option<TypedValue>
pub fn get_vector_element(self, elem_num: usize) -> Option<TypedValue>
Retrieve an element from a vector at the given index. Return None of index out-of-bounds.
sourcepub fn borrow_ref_vector_element(
self,
elem_num: usize,
is_mut: bool,
local_idx: TempIndex
) -> Option<TypedValue>
pub fn borrow_ref_vector_element( self, elem_num: usize, is_mut: bool, local_idx: TempIndex ) -> Option<TypedValue>
Borrow an element from a vector at the given index. Return None of index out-of-bounds.
sourcepub fn update_ref_vector_push_back(self, elem_val: TypedValue) -> TypedValue
pub fn update_ref_vector_push_back(self, elem_val: TypedValue) -> TypedValue
Push an element back to a vector
sourcepub fn update_ref_vector_pop_back(self) -> Option<(TypedValue, TypedValue)>
pub fn update_ref_vector_pop_back(self) -> Option<(TypedValue, TypedValue)>
Pop an element from the back of the vector
sourcepub fn update_ref_vector_swap(self, lhs: usize, rhs: usize) -> Option<TypedValue>
pub fn update_ref_vector_swap(self, lhs: usize, rhs: usize) -> Option<TypedValue>
Swap two elements in the vector
sourcepub fn update_ref_vector_element(
self,
elem_num: usize,
elem_val: TypedValue
) -> TypedValue
pub fn update_ref_vector_element( self, elem_num: usize, elem_val: TypedValue ) -> TypedValue
Update an element in the vector, creates a new vector that contains the update
sourcepub fn unpack_struct(self) -> Vec<TypedValue> ⓘ
pub fn unpack_struct(self) -> Vec<TypedValue> ⓘ
Unpack a struct value
sourcepub fn unpack_struct_field(self, field_num: usize) -> TypedValue
pub fn unpack_struct_field(self, field_num: usize) -> TypedValue
Unpack one specific field from a struct value
sourcepub fn unpack_ref_struct_field(
self,
field_num: usize,
is_mut_opt: Option<bool>
) -> TypedValue
pub fn unpack_ref_struct_field( self, field_num: usize, is_mut_opt: Option<bool> ) -> TypedValue
Unpack one specific field from a struct reference
sourcepub fn borrow_ref_struct_field(
self,
field_num: usize,
is_mut: bool,
local_idx: TempIndex
) -> TypedValue
pub fn borrow_ref_struct_field( self, field_num: usize, is_mut: bool, local_idx: TempIndex ) -> TypedValue
Borrow one specific field from a struct reference
sourcepub fn update_ref_struct_field(
self,
field_num: usize,
field_val: TypedValue
) -> TypedValue
pub fn update_ref_struct_field( self, field_num: usize, field_val: TypedValue ) -> TypedValue
update one specific field from a struct reference, create a new struct reference
sourcepub fn into_bcs_bytes(self) -> Option<Vec<u8>>
pub fn into_bcs_bytes(self) -> Option<Vec<u8>>
Into BCS-serialized bytes
Trait Implementations§
source§impl Clone for TypedValue
impl Clone for TypedValue
source§fn clone(&self) -> TypedValue
fn clone(&self) -> TypedValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypedValue
impl Debug for TypedValue
source§impl Ord for TypedValue
impl Ord for TypedValue
source§fn cmp(&self, other: &TypedValue) -> Ordering
fn cmp(&self, other: &TypedValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<TypedValue> for TypedValue
impl PartialEq<TypedValue> for TypedValue
source§fn eq(&self, other: &TypedValue) -> bool
fn eq(&self, other: &TypedValue) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TypedValue> for TypedValue
impl PartialOrd<TypedValue> for TypedValue
source§fn partial_cmp(&self, other: &TypedValue) -> Option<Ordering>
fn partial_cmp(&self, other: &TypedValue) -> Option<Ordering>
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 moreimpl Eq for TypedValue
impl StructuralEq for TypedValue
impl StructuralPartialEq for TypedValue
Auto Trait Implementations§
impl RefUnwindSafe for TypedValue
impl Send for TypedValue
impl Sync for TypedValue
impl Unpin for TypedValue
impl UnwindSafe for TypedValue
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.