Struct elrond_wasm::contract_base::StorageRawWrapper
source · pub struct StorageRawWrapper<A>where
A: StorageReadApi + ManagedTypeApi + ErrorApi,{ /* private fields */ }
Implementations§
source§impl<A> StorageRawWrapper<A>where
A: StorageReadApi + StorageWriteApi + ManagedTypeApi + ErrorApi,
impl<A> StorageRawWrapper<A>where
A: StorageReadApi + StorageWriteApi + ManagedTypeApi + ErrorApi,
pub fn new() -> Self
sourcepub fn read<K, V>(&self, storage_key: K) -> Vwhere
K: Into<StorageKey<A>>,
V: TopDecode,
pub fn read<K, V>(&self, storage_key: K) -> Vwhere
K: Into<StorageKey<A>>,
V: TopDecode,
Reads storage from the given key, and deserializes the value to the provided type.
Use only if really necessary, storage mappers should be preferred.
sourcepub fn read_from_address<K, V>(
&self,
address: &ManagedAddress<A>,
storage_key: K
) -> Vwhere
K: Into<StorageKey<A>>,
V: TopDecode,
pub fn read_from_address<K, V>(
&self,
address: &ManagedAddress<A>,
storage_key: K
) -> Vwhere
K: Into<StorageKey<A>>,
V: TopDecode,
Reads storage from another address (usually a smart contract), from the given key, and deserializes the value to the provided type.
This is a synchronous call, so it only works when both the current contract and the destination are in the same shard.
Trait Implementations§
source§impl<A> Default for StorageRawWrapper<A>where
A: StorageReadApi + ManagedTypeApi + ErrorApi + Default,
impl<A> Default for StorageRawWrapper<A>where
A: StorageReadApi + ManagedTypeApi + ErrorApi + Default,
source§fn default() -> StorageRawWrapper<A>
fn default() -> StorageRawWrapper<A>
Returns the “default value” for a type. Read more