[][src]Enum solana_libra_vm_runtime_types::value::ReferenceValue

pub enum ReferenceValue {
    Reference(Reference),
    GlobalRef(GlobalRef),
}

The wrapper for all things reference in the VM. Right now we have 2 kind of references: local and global. This enum wraps both and offers a common API.

Variants

Reference(Reference)
GlobalRef(GlobalRef)

Methods

impl ReferenceValue[src]

Implementation for reference opcodes.

A reference in the runtime can have different shapes so any time a reference is expected a ReferenceValue is created by popping whatever reference is on the stack. Operations on the reference (via opcodes) are then invoked on a ReferenceValue.

pub fn new(value: Value) -> VMResult<Self>[src]

Create a ReferenceValue from a Value popped off the stack. Fails if the value is not a reference of some kind.

pub fn borrow_field(self, field_offset: usize) -> VMResult<Value>[src]

Borrow a field from the reference if the reference is to a struct.

pub fn read_ref(self) -> VMResult<Value>[src]

Read the value pointed to by the reference.

pub fn write_ref(self, value: Value)[src]

Write value to the location pointed to by the reference.

Trait Implementations

impl Clone for ReferenceValue[src]

impl Debug for ReferenceValue[src]

impl Eq for ReferenceValue[src]

impl PartialEq<ReferenceValue> for ReferenceValue[src]

impl StructuralEq for ReferenceValue[src]

impl StructuralPartialEq for ReferenceValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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