pub struct TypedValue { /* private fields */ }

Implementations§

source§

impl TypedValue

source

pub fn fuse_base(ty: BaseType, val: BaseValue) -> Self

source

pub fn mk_bool(v: bool) -> Self

source

pub fn mk_u8(v: u8) -> Self

source

pub fn mk_u64(v: u64) -> Self

source

pub fn mk_u128(v: u128) -> Self

source

pub fn mk_num(v: BigInt) -> Self

source

pub fn mk_address(v: AccountAddress) -> Self

source

pub fn mk_signer(v: AccountAddress) -> Self

source

pub fn mk_vector(elem: BaseType, v: Vec<TypedValue>) -> Self

source

pub fn mk_struct(inst: StructInstantiation, v: Vec<TypedValue>) -> Self

source

pub fn mk_ref_bool(v: bool, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_u8(v: u8, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_u64(v: u64, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_u128(v: u128, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_num(v: BigInt, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_address(v: AccountAddress, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_signer(v: AccountAddress, is_mut: bool, ptr: Pointer) -> Self

source

pub fn mk_ref_vector( elem: BaseType, v: Vec<TypedValue>, is_mut: bool, ptr: Pointer ) -> Self

source

pub fn mk_ref_struct( inst: StructInstantiation, v: Vec<TypedValue>, is_mut: bool, ptr: Pointer ) -> Self

source

pub fn into_bool(self) -> bool

source

pub fn into_u8(self) -> u8

source

pub fn into_u64(self) -> u64

source

pub fn into_u128(self) -> u128

source

pub fn into_num(self) -> BigInt

source

pub fn into_int(self) -> BigInt

source

pub fn into_address(self) -> AccountAddress

source

pub fn into_signer(self) -> AccountAddress

source

pub fn into_vector(self) -> Vec<BaseValue>

source

pub fn into_struct(self) -> Vec<BaseValue>

source

pub fn into_ref_bool(self) -> (bool, bool, Pointer)

source

pub fn into_ref_u8(self) -> (u8, bool, Pointer)

source

pub fn into_ref_u64(self) -> (u64, bool, Pointer)

source

pub fn into_ref_u128(self) -> (u128, bool, Pointer)

source

pub fn into_ref_num(self) -> (BigInt, bool, Pointer)

source

pub fn into_ref_address(self) -> (AccountAddress, bool, Pointer)

source

pub fn into_ref_signer(self) -> (AccountAddress, bool, Pointer)

source

pub fn into_ref_vector(self) -> (Vec<BaseValue>, bool, Pointer)

source

pub fn into_ref_struct(self) -> (Vec<BaseValue>, bool, Pointer)

source

pub fn get_ty(&self) -> &Type

source

pub fn get_val(&self) -> &BaseValue

source

pub fn get_ptr(&self) -> &Pointer

source

pub fn decompose(self) -> (Type, BaseValue, Pointer)

source

pub fn assign_cast(self, ty: Type) -> TypedValue

Cast this value into a compatible type. Cast ty must be compatible

source

pub fn borrow_local(self, is_mut: bool, local_idx: TempIndex) -> TypedValue

Create a reference to the base value

source

pub fn read_ref(self) -> TypedValue

Read the reference and create a base value

source

pub fn write_ref(self, ptr: Pointer) -> TypedValue

Create a mutable reference to this base value

source

pub fn freeze_ref(self) -> TypedValue

Convert the mutable reference into immutable

source

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

source

pub fn unbox_from_mut_ref_arg(self) -> TypedValue

Unwrap the pointer from the mutable reference to its original pointer

source

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

source

pub fn unbox_from_mut_ref_ret(self) -> TypedValue

Unwrap the pointer from the mutable reference to its original pointer

source

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.

source

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.

source

pub fn update_ref_vector_push_back(self, elem_val: TypedValue) -> TypedValue

Push an element back to a vector

source

pub fn update_ref_vector_pop_back(self) -> Option<(TypedValue, TypedValue)>

Pop an element from the back of the vector

source

pub fn update_ref_vector_swap(self, lhs: usize, rhs: usize) -> Option<TypedValue>

Swap two elements in the vector

source

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

source

pub fn unpack_struct(self) -> Vec<TypedValue>

Unpack a struct value

source

pub fn unpack_struct_field(self, field_num: usize) -> TypedValue

Unpack one specific field from a struct value

source

pub fn unpack_ref_struct_field( self, field_num: usize, is_mut_opt: Option<bool> ) -> TypedValue

Unpack one specific field from a struct reference

source

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

source

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

source

pub fn into_bcs_bytes(self) -> Option<Vec<u8>>

Into BCS-serialized bytes

Trait Implementations§

source§

impl Clone for TypedValue

source§

fn clone(&self) -> TypedValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TypedValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for TypedValue

source§

fn cmp(&self, other: &TypedValue) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<TypedValue> for TypedValue

source§

fn eq(&self, other: &TypedValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<TypedValue> for TypedValue

source§

fn partial_cmp(&self, other: &TypedValue) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for TypedValue

source§

impl StructuralEq for TypedValue

source§

impl StructuralPartialEq for TypedValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V