fixed_typemap

Crates.iofixed_typemap
lib.rsfixed_typemap
version0.1.0
sourcesrc
created_at2021-12-26 19:34:18.19654
updated_at2021-12-26 19:34:18.19654
descriptionA typemap which can allocate types inline with zero overhead and allow for iteration by traits
homepagehttps://docs.rs/fixed_typemap
repositoryhttps://github.com/ahicks92/fixed_typemap
max_upload_size
id503420
size31,170
Austin Hicks (ahicks92)

documentation

README

fixed_typemap

GitHub Actions docs.rs GitHub Sponsors

Implements typemaps that support a lot of extra funcctionality using procedural macros. docs.rs has a lot more than this readme, including a mini-tutorial and worked example. You can use this to:

  • Implement fixed typemaps which don't allocate, and store all their members inline initialized to default values.
  • Use this to implement something like the fields-in-traits proposal, where you "name" fields generically using types.
  • Generate iteration helpers which can iterate over the typemap as trait objects for any number of traits (e.g. this can replace HashMap<TypeId, Box<dyn MyTrait>>, bringing the rest of the functionality along for the ride and also let you do as many traits as you want at once).
  • Add an optional dynamic section which uses a HashMap to enable storing any type.

no_std support is WIP in the sense that it's basically done but I don't know enough to reliably finish it. Doing so shouldn't be hard and I'm very open to contributions which do so and preferrably provide CI configuration.

Commit count: 36

cargo fmt