Module thread_local

Module thread_local 

Source
Expand description

Manage the thread local fallback handler.

Statics§

DEFAULT_THREAD_LOCAL_FALLBACK_HANDLER
The default thread local fallback handler.

Functions§

install
Install a new fallback thread local handler.
install_dyn
Install a new fallback thread local handler. Must be a dynamic trait object.
read
Get a reference to the current fallback thread local handler.
read_or_default
Get a reference to the current fallback thread local handler.
replace
Replace the current fallback thread local handler with a new one, returning the old one if any.
replace_dyn
Replace the current fallback thread local handler with a new one, returning the old one if any. Must be a dynamic trait object.
scope
Sets the fallback thread local handler to the specified one for the duration of the scope.
scope_dyn
Sets the fallback thread local handler to the specified one for the duration of the scope. Must be a dynamic trait object.
take
Take the current fallback thread local handler, if there is any.
try_read
Try to get a reference to the current fallback thread local handler.
try_write
Try to get a mutable reference to the current fallback thread local handler.
uninstall
Uninstall the current fallback thread local handler.
write
Get a mutable reference to the current fallback thread local handler.
write_or_default
Get a mutable reference to the current fallback thread local handler.

Type Aliases§

BoxDynTryDropStrategy
A handy type alias for Box<dyn ThreadLocalTryDropStrategy>.
ScopeGuard
A scope guard for the thread local fallback handler. This sets the thread local fallback handler to the one specified for the duration of the scope.
ThreadLocalFallbackHandler
A fallback handler that uses the thread local scope.