Small_type_id: crate with 32 bit const TypeIds for user types

Link: small_type_id

I was wanting to have some compile time TypeIds so I can run const assertions in my ECS engine.

While working on it, I thought that it may be useful for other developers so I released it as a separate crate.

Features:

  1. TYPE_ID is a constant (vs runtime only in std).
  2. Size is 32 bit (vs unspecified 16 bytes in std).
  3. TypeId cannot be zero which allows niche optimizations
  4. Most significant bit is guaranteed to be zero to allow users mix it with another 32 bit ids (e.g. using union).
  5. Uniqueness of ids are checked in runtime before main by using ctor crate + linker section tricks.

Also, I take effort to make crate not dependent from quote, syn and proc_macro2 because I find bottlenecking on them during compilation of large projects slightly annoying.

Hopefully, it would be useful.