Crate phoenix_tls

Crate phoenix_tls 

Source
Expand description

Utilities for creating always present thread locals.

The phoenix_tls! macro creates a thread_local! style variable that is lazily initialized. If the thread_local is accessed after it’s destroyed, a new temporary will be created using Default::default().

All phoenix thread locals (Phoenix) are internally reference counted heap allocated structures.

Additionally the user type receives two callbacks subscribe/unsubscribe, which are invoked at creation/desctruction. The address is stable between those two calls.

Macros§

phoenix_tls

Structs§

NoSubscribe
Phoenix
PhoenixKey

Traits§

PhoenixTarget
Types that can be stored in phoenix_tls’s can implement this for optional callback hooks for when they are created/destroyed.