[−][src]Macro pui_core::make_type_id
Create a new Type<T>
Two calls to scope
will never return the same type
(the difference is in the types)
ⓘ
let a = pui_core::make_type_id!(); let b = pui_core::make_type_id!(); assert_eq!(a, b);
let a = pui_core::make_type_id!(); assert_eq!(a, a);
You can also declare your own unit struct that
that will be used to generate a Type
. Note:
this can only be used in positions where let
bindings are valid.
pui_core::make_type_id! { /// Documentation for Foo #[derive(Debug, Clone, Copy)] pub let Foo; } let token = Foo.token();
Or in positions where static
is valid.
pui_core::make_type_id! { /// Documentation for Foo #[derive(Debug, Clone, Copy)] pub static Foo; } let token = Foo.token();