Trait near_vm_logic::ValuePtr[][src]

pub trait ValuePtr {
    fn len(&self) -> u32;
fn deref(&self) -> Result<Vec<u8>, VMLogicError>; }

Logical pointer to a value in storage. Allows getting value length before getting the value itself. This is needed so that runtime can charge gas before accessing a potentially large value.

Required methods

fn len(&self) -> u32[src]

Returns the length of the value

fn deref(&self) -> Result<Vec<u8>, VMLogicError>[src]

Dereferences the pointer. Takes a box because currently runtime code uses dynamic dispatch.

Errors

StorageError if reading from storage fails

Loading content...

Implementors

impl ValuePtr for MockedValuePtr[src]

Loading content...