type-key 1.0.0

Unique type identifier for any non-static type
Documentation
  • Coverage
  • 25%
    1 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 3.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.4 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • storycraft

TypeKey

Unique type identifier for any non-static type (unlike core::any::Any)

Usage

use type_key::TypeKey;

let a = 1;
let closure = || &a;

let key = TypeKey::of_val(&closure);

Implementation detail

The TypeKey wraps TypeId of closure in TypeKey::of. Since the closure captures its environment, the returned TypeId is unique for each type.

License

MIT