type-key

Crates.iotype-key
lib.rstype-key
version1.0.0
sourcesrc
created_at2023-06-22 07:32:53.359259
updated_at2023-06-22 14:26:28.224945
descriptionUnique type identifier for any non-static type
homepage
repository
max_upload_size
id896983
size3,472
storycraft (storycraft)

documentation

README

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

Commit count: 0

cargo fmt