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

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

Returns the length of the value

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

Errors

StorageError if reading from storage fails

Implementors