Attribute Macro cw_storage_plus::index_list
source · #[index_list]
Expand description
Auto generate an IndexList
impl for your indexes struct.
§Example
use cosmwasm_std::Addr;
use cw_storage_plus::{MultiIndex, UniqueIndex, index_list};
use serde::{Serialize, Deserialize};
#[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, ()>,
}