| Crates.io | rand_map |
| lib.rs | rand_map |
| version | 0.1.1 |
| created_at | 2022-06-13 14:38:31.086423+00 |
| updated_at | 2025-08-30 15:06:53.416234+00 |
| description | A map that creates a random handle on insertion to use when retrieving |
| homepage | |
| repository | https://github.com/andersjl/rand_map |
| max_upload_size | |
| id | 605149 |
| size | 14,968 |
A map that creates a random handle on insertion to use when retrieving.
The raison d'ĂȘtre for this map is:
You want to put something in a map, but you have no key. Means you do
not want to use a HashMap
or
BTreeMap
.
You want to forget the details of what you put in to later retrieve it
with a simple handle, and you are not interested in how many equal
objects you insert. Means you do not want to use a HashSet
or
HashMultiSet
.
You want a persistent handle to refer to the item you put in the map.
Means you do not want to use a Vec.
The implementation uses a HashMap that does not actually hash. The
contained HashMap can be borrowed (.as_hash_map()), so all HashMap
functions that do not change the map are at your disposal.