[][src]Trait casper_types::mint::StorageProvider

pub trait StorageProvider {
    fn new_uref<T: CLTyped + ToBytes>(&mut self, init: T) -> URef;
fn write_local<K: ToBytes, V: CLTyped + ToBytes>(
        &mut self,
        key: K,
        value: V
    );
fn read_local<K: ToBytes, V: CLTyped + FromBytes>(
        &mut self,
        key: &K
    ) -> Result<Option<V>, Error>;
fn read<T: CLTyped + FromBytes>(
        &mut self,
        uref: URef
    ) -> Result<Option<T>, Error>;
fn write<T: CLTyped + ToBytes>(
        &mut self,
        uref: URef,
        value: T
    ) -> Result<(), Error>;
fn add<T: CLTyped + ToBytes>(
        &mut self,
        uref: URef,
        value: T
    ) -> Result<(), Error>; }

Provides functionality of a contract storage.

Required methods

fn new_uref<T: CLTyped + ToBytes>(&mut self, init: T) -> URef

Create new URef.

fn write_local<K: ToBytes, V: CLTyped + ToBytes>(&mut self, key: K, value: V)

Write data to a local key.

fn read_local<K: ToBytes, V: CLTyped + FromBytes>(
    &mut self,
    key: &K
) -> Result<Option<V>, Error>

Read data from a local key.

fn read<T: CLTyped + FromBytes>(
    &mut self,
    uref: URef
) -> Result<Option<T>, Error>

Read data from URef.

fn write<T: CLTyped + ToBytes>(
    &mut self,
    uref: URef,
    value: T
) -> Result<(), Error>

Write data under a URef.

fn add<T: CLTyped + ToBytes>(
    &mut self,
    uref: URef,
    value: T
) -> Result<(), Error>

Add data to a URef.

Loading content...

Implementors

Loading content...