Struct rustc_data_structures::sync::OneThread
source · pub struct OneThread<T> {
thread: ThreadId,
inner: T,
}Expand description
A type which only allows its inner value to be used in one thread. It will panic if it is used on multiple threads.
Fields§
§thread: ThreadId§inner: TImplementations§
Trait Implementations§
impl<T> DynSync for OneThread<T>
impl<T> Send for OneThread<T>
impl<T> Sync for OneThread<T>
Auto Trait Implementations§
impl<T> DynSend for OneThread<T>where
T: DynSend,
impl<T> RefUnwindSafe for OneThread<T>where
T: RefUnwindSafe,
impl<T> Unpin for OneThread<T>where
T: Unpin,
impl<T> UnwindSafe for OneThread<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
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.