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

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

Provides functionality of a contract storage.

Required methods

pub fn new_uref<T: CLTyped + ToBytes>(&mut self, init: T) -> Result<URef, Error>[src]

Create new URef.

pub fn write_local<K: ToBytes, V: CLTyped + ToBytes>(
    &mut self,
    key: K,
    value: V
) -> Result<(), Error>
[src]

Write data to a local key.

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

Read data from a local key.

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

Read data from URef.

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

Write data under a URef.

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

Add data to a URef.

Loading content...

Implementors

Loading content...