Trait sc_rpc::offchain::OffchainApi[][src]

pub trait OffchainApi: 'static + Send + Sync {
    pub fn set_local_storage(
        &self,
        kind: StorageKind,
        key: Bytes,
        value: Bytes
    ) -> Result<(), Error>;
pub fn get_local_storage(
        &self,
        kind: StorageKind,
        key: Bytes
    ) -> Result<Option<Bytes>, Error>; pub fn to_delegate<M>(self) -> IoDelegate<Self, M>
    where
        M: Metadata
, { ... } }

Substrate offchain RPC API

Required methods

pub fn set_local_storage(
    &self,
    kind: StorageKind,
    key: Bytes,
    value: Bytes
) -> Result<(), Error>
[src]

Set offchain local storage under given key and prefix.

pub fn get_local_storage(
    &self,
    kind: StorageKind,
    key: Bytes
) -> Result<Option<Bytes>, Error>
[src]

Get offchain local storage under given key and prefix.

Loading content...

Provided methods

pub fn to_delegate<M>(self) -> IoDelegate<Self, M> where
    M: Metadata
[src]

Create an IoDelegate, wiring rpc calls to the trait methods.

Loading content...

Implementors

impl<T: OffchainStorage + 'static> OffchainApi for Offchain<T>[src]

fn set_local_storage(
    &self,
    kind: StorageKind,
    key: Bytes,
    value: Bytes
) -> Result<()>
[src]

Set offchain local storage under given key and prefix.

fn get_local_storage(
    &self,
    kind: StorageKind,
    key: Bytes
) -> Result<Option<Bytes>>
[src]

Get offchain local storage under given key and prefix.

Loading content...