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