pub(crate) struct ThreadBound<T> {
value: T,
thread_id: ThreadId,
}
Expand description
ThreadBound is a Sync-maker and Send-maker that allows accessing a value of type T only from the original thread on which the ThreadBound was constructed.
Fields§
§value: T
§thread_id: ThreadId
Implementations§
Trait Implementations§
source§impl<T: Copy> Clone for ThreadBound<T>
impl<T: Copy> Clone for ThreadBound<T>
source§impl<T: Debug> Debug for ThreadBound<T>
impl<T: Debug> Debug for ThreadBound<T>
impl<T: Copy> Copy for ThreadBound<T>
impl<T: Copy> Send for ThreadBound<T>
impl<T> Sync for ThreadBound<T>
Auto Trait Implementations§
impl<T> Freeze for ThreadBound<T>where
T: Freeze,
impl<T> RefUnwindSafe for ThreadBound<T>where
T: RefUnwindSafe,
impl<T> Unpin for ThreadBound<T>where
T: Unpin,
impl<T> UnwindSafe for ThreadBound<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)