Trait sc_rpc_api::offchain::OffchainApi  [−][src]
pub trait OffchainApi: Sized + Send + Sync + 'static { fn set_local_storage(
&self,
kind: StorageKind,
key: Bytes,
value: Bytes
) -> Result<()>; fn get_local_storage(
&self,
kind: StorageKind,
key: Bytes
) -> Result<Option<Bytes>>; fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... } }
Expand description
Substrate offchain RPC API
Required methods
fn set_local_storage(
    &self, 
    kind: StorageKind, 
    key: Bytes, 
    value: Bytes
) -> Result<()>
fn set_local_storage(
    &self, 
    kind: StorageKind, 
    key: Bytes, 
    value: Bytes
) -> Result<()>Set offchain local storage under given key and prefix.
fn get_local_storage(
    &self, 
    kind: StorageKind, 
    key: Bytes
) -> Result<Option<Bytes>>
fn get_local_storage(
    &self, 
    kind: StorageKind, 
    key: Bytes
) -> Result<Option<Bytes>>Get offchain local storage under given key and prefix.
Provided methods
fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>
fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>Create an IoDelegate, wiring rpc calls to the trait methods.