Title: Initializing a LookupMap with near-sdk-rust
Tags: rust;webassembly;smartcontracts;nearprotocol
Question: I am currently developing a contract where I want to make use of a LookupMap, however it's not clear to me how to initialize it. Here is the code:
```// Just a structyre
pub struct Gift {
    url: String,
    n_tokens_required: usize,
    current_tokens: usize,
}

// Main contract code
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize)]
pub struct Voting { // TODO: Rename this class
    pub gifts: LookupMap<String, Vector<Gift&gt;&gt;,
    pub contract_owner: String,
}

impl Default for Voting {
    fn default() -&gt; Self {
        Voting {gifts: LookupMap181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16new(), contract_owner: env181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16urrent_account_id()}
    }
}
```
So I want the gifts attribute of my contract to be a LookupMap with the signature ```LookupMap<String, Vector<Gift&gt;&gt;```. How can I initialize it on my  default function implementation?
When I try to do ```LookupMap181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16new()```, it says that I need a parameter key_prefix, with the trait IntoStorageKey, however it's not clear to me what this parameter actually is.
Could anyone help me understand this better?
Thank you!


Here is the accepted answer: You will find your answer on this page https://www.near-sdk.io/contract-structure/collections



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:01/29/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<rust><webassembly><smartcontracts><nearprotocol>', 'Title': 'Initializing a LookupMap with near-sdk-rust', 'ViewCount': 215, 'id': 70906456, 'user_AboutMe': None, 'user_AccountId': 24092691.0, 'user_DisplayName': 'Barro', 'user_Reputation': 21.0, 'user_Views': 0.0, 'user_id': 18065732.0}}