#typemap #hash-map #type

typemap_rev

A hashmap, but stores types as keys

9 releases

0.4.0 Jun 14, 2025
0.3.0 Nov 20, 2022
0.2.0 Aug 30, 2022
0.1.5 Apr 9, 2021
0.1.3 Jul 16, 2020

#158 in Data structures

Download history 31331/week @ 2026-01-08 44276/week @ 2026-01-15 25900/week @ 2026-01-22 33846/week @ 2026-01-29 38211/week @ 2026-02-05 42952/week @ 2026-02-12 47468/week @ 2026-02-19 63823/week @ 2026-02-26 80309/week @ 2026-03-05 99075/week @ 2026-03-12 71005/week @ 2026-03-19 82822/week @ 2026-03-26 105081/week @ 2026-04-02 115086/week @ 2026-04-09 98562/week @ 2026-04-16 78853/week @ 2026-04-23

414,386 downloads per month
Used in 143 crates (16 directly)

ISC license

18KB
359 lines

TypeMap Revitalized

An updated version of the crate typemap which is a hashmap whose keys are defined by types.

Original code created by: Acdenissk

Crate created by: kingbri

Documentation

Documentation is located here

Example

use typemap_rev::{ TypeMap, TypeMapKey };

struct Number;

impl TypeMapKey for Number {
    type Value = i32;
}

let mut map = TypeMap::new();
map.insert::<Number>(42);

Help/Support

Join the Serenity-rs Discord server here: https://discord.gg/9X7vCus and feel free to ask your questions!

No runtime deps