Struct thread_local::ThreadLocal [−][src]
Expand description
Thread-local variable wrapper
See the module-level documentation for more.
Implementations
Creates a new empty ThreadLocal
.
Returns the element for the current thread, or creates it if it doesn’t exist.
Returns the element for the current thread, or creates it if it doesn’t
exist. If create
fails, that error is returned and no element is
added.
Returns a mutable iterator over the local values of all threads.
Since this call borrows the ThreadLocal
mutably, this operation can
be done safely—the mutable borrow statically guarantees no other
threads are currently accessing their associated values.
Removes all thread-specific values from the ThreadLocal
, effectively
reseting it to its original state.
Since this call borrows the ThreadLocal
mutably, this operation can
be done safely—the mutable borrow statically guarantees no other
threads are currently accessing their associated values.
Returns the element for the current thread, or creates a default one if it doesn’t exist.