Crates.io | cw-storage-macro |
lib.rs | cw-storage-macro |
version | 2.0.0 |
source | src |
created_at | 2022-07-28 12:00:51.040942 |
updated_at | 2024-03-14 16:08:52.26339 |
description | Macro helpers for storage-plus |
homepage | https://cosmwasm.com |
repository | https://github.com/CosmWasm/cw-storage-plus |
max_upload_size | |
id | 634363 |
size | 3,848 |
Procedural macros helper for interacting with cw-storage-plus and cosmwasm-storage.
Auto generate an IndexList
impl for your indexes struct.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
struct TestStruct {
id: u64,
id2: u32,
addr: Addr,
}
#[index_list(TestStruct)] // <- Add this line right here.
struct TestIndexes<'a> {
id: MultiIndex<'a, u32, TestStruct, u64>,
addr: UniqueIndex<'a, Addr, TestStruct, String>,
}