pub struct ThreadLocal<T> { /* private fields */ }Expand description
A thread-local storage slot holding an independent value of type T per thread.
The value for each thread is constructed lazily on first access using the init
function supplied at creation time, and dropped when the thread exits.
Implementations§
Trait Implementations§
Source§impl<T> Drop for ThreadLocal<T>
impl<T> Drop for ThreadLocal<T>
impl<T: Send> Send for ThreadLocal<T>
impl<T: Send> Sync for ThreadLocal<T>
Auto Trait Implementations§
impl<T> Freeze for ThreadLocal<T>
impl<T> RefUnwindSafe for ThreadLocal<T>where
T: RefUnwindSafe,
impl<T> Unpin for ThreadLocal<T>
impl<T> UnsafeUnpin for ThreadLocal<T>
impl<T> UnwindSafe for ThreadLocal<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more