[−][src]Macro pui::make_typeid_tl
This is supported on crate feature
std
only.Create a new type that can be used with typeid_tl::Type
calling make_typeid_tl
like so,
pui::make_typeid_tl! { once type OnceThreadLocal; }
will desugar to something like
struct OnceThreadLocal; impl OnceThreadLocal { pub fn new() -> pui::typeid_tl::Type<Self> { Self::try_new().unwrap() } pub fn try_new() -> Option<pui::typeid_tl::Type<Self>> { // implementation details } }
You can use OnceThreadLocal::new()
to create a new thread local
identifier instance if you are sure there are no other instances
active, otherwise use OnceThreadLocal::try_new()