Module thread_local

Module thread_local 

Source
Expand description

Manage the thread local primary handler.

Statics§

DEFAULT_THREAD_LOCAL_PRIMARY_HANDLER
The default thread local primary handler.

Functions§

install
Install a new thread local primary handler.
install_dyn
Install a new thread local primary handler. Must be a dynamic trait object.
read
Get a reference to the current thread local primary handler.
read_or_default
Get a reference to the current thread local primary handler.
replace
Replace the current thread local primary handler with the given one, returning the old one if any.
replace_dyn
Replace the current thread local primary handler with the given one, returning the old one if any. Must be a dynamic trait object.
scope
Sets the thread local primary handler to the given one for the duration of the given scope. For more advanced usage, see the ScopeGuard type.
scope_dyn
Sets the thread local primary handler to the given one for the duration of the given scope. For more advanced usage, see the ScopeGuard type. Must be a dynamic trait object.
take
Take the current thread local primary handler, if there is any initalized.
try_read
Try and get a reference to the current thread local primary handler.
try_write
Try and get a mutable reference to the current thread local primary handler.
uninstall
Uninstall the current thread local primary handler.
write
Get a mutable reference to the current thread local primary handler.
write_or_default
Get a mutable reference to the current thread local primary handler.

Type Aliases§

BoxDynFallibleTryDropStrategy
Handy type alias to Box<dyn ThreadLocalFallibleTryDropStrategy>.
ScopeGuard
A scope guard for the thread local primary handler. It is used to set the thread local primary handler for the duration of the scope.
ThreadLocalPrimaryHandler
A primary handler that uses the thread local scope.