pub struct PerThread<T> { /* private fields */ }
Expand description
Values inserted into the map are returned to the caller inside this wrapper. The caller will hold on to this wrapper as long as they like, then when they drop it the corresponding entry is removed from the map.
The map data structure holds a pointer NonNull<T>
to the content of the
storage box. We must not expose an API through which the owner of a
PerThread<T>
could invalidate that pointer, for example by moving the content
or dropping the content outside of PerThread’s Drop impl.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for PerThread<T>where
T: RefUnwindSafe,
impl<T> Send for PerThread<T>where
T: Send,
impl<T> Sync for PerThread<T>
impl<T> Unpin for PerThread<T>
impl<T> UnwindSafe for PerThread<T>where
T: UnwindSafe,
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