rand_map

Crates.iorand_map
lib.rsrand_map
version0.1.1
created_at2022-06-13 14:38:31.086423+00
updated_at2025-08-30 15:06:53.416234+00
descriptionA map that creates a random handle on insertion to use when retrieving
homepage
repositoryhttps://github.com/andersjl/rand_map
max_upload_size
id605149
size14,968
Anders Lindeberg (andersjl)

documentation

README

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.

Commit count: 9

cargo fmt