pub struct Value(_);
Expand description

A Move value – a wrapper around ValueImpl which can be created only through valid means.

Implementations§

source§

impl Value

source

pub fn as_move_value(&self, layout: &MoveTypeLayout) -> MoveValue

source§

impl Value

source

pub fn copy_value(&self) -> PartialVMResult<Self>

source§

impl Value

source

pub fn equals(&self, other: &Self) -> PartialVMResult<bool>

source§

impl Value

source

pub fn u8(x: u8) -> Self

source

pub fn u64(x: u64) -> Self

source

pub fn u128(x: u128) -> Self

source

pub fn bool(x: bool) -> Self

source

pub fn address(x: AccountAddress) -> Self

source

pub fn signer(x: AccountAddress) -> Self

source

pub fn signer_reference(x: AccountAddress) -> Self

Create a “unowned” reference to a signer value (&signer) for populating the &signer in execute function

source

pub fn struct_(s: Struct) -> Self

source

pub fn vector_u8(it: impl IntoIterator<Item = u8>) -> Self

source

pub fn vector_u64(it: impl IntoIterator<Item = u64>) -> Self

source

pub fn vector_u128(it: impl IntoIterator<Item = u128>) -> Self

source

pub fn vector_bool(it: impl IntoIterator<Item = bool>) -> Self

source

pub fn vector_address(it: impl IntoIterator<Item = AccountAddress>) -> Self

source

pub fn vector_for_testing_only(it: impl IntoIterator<Item = Value>) -> Self

source§

impl Value

source

pub fn value_as<T>(self) -> PartialVMResult<T>where Self: VMValueCast<T>,

source§

impl Value

source

pub fn size(&self) -> AbstractMemorySize<GasCarrier>

source§

impl Value

source

pub fn simple_deserialize(blob: &[u8], layout: &MoveTypeLayout) -> Option<Value>

source

pub fn simple_serialize(&self, layout: &MoveTypeLayout) -> Option<Vec<u8>>

source§

impl Value

source

pub fn deserialize_constant(constant: &Constant) -> Option<Value>

Trait Implementations§

Auto Trait Implementations§

§

impl !RefUnwindSafe for Value

§

impl !Send for Value

§

impl !Sync for Value

§

impl Unpin for Value

§

impl !UnwindSafe for Value

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<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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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