1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Storage extensions for pwasm-std
//!
//! Storage api is a key-value storage where both key and value are 32 bytes in len
//!
//! # Examples
//!
//! ```rust
//! use pwasm_std::hash::H256;
//!
//! # // We can't use original definitions of storage::read/write
//! # // because they require externs to be defined.
//! # mod storage {
//! # use pwasm_std::hash::H256;
//! # pub fn read(key: &H256) -> [u8; 32] { [0u8; 32] }
//! # pub fn write(key: &H256, val: &[u8; 32]) { }
//! # }
//!
//! storage::write(&H256::from([1u8; 32]), &[1u8; 32]);
//! let _v = storage::read(&H256::from([1u8; 32]));
//! ```
use H256;
extern
/// Performs read from the storage.
/// Performs write to the storage