Struct riot_wrappers::thread::ValueInThread
source · pub struct ValueInThread<T> { /* private fields */ }
Expand description
A value combined with an InThread marker
This does barely implement anything on its own, but the module implementing T
might provide
extra methods.
This makes the wrapped value not Send
.
Implementations§
source§impl<T> ValueInThread<T>
impl<T> ValueInThread<T>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extract the wrapped value
This does not produce the original in_thread
value; these are easy enough to re-obtain or
to keep a copy of around.
source§impl<'a, T> ValueInThread<&'a Mutex<T>>
impl<'a, T> ValueInThread<&'a Mutex<T>>
sourcepub fn lock(self) -> MutexGuard<'a, T>
pub fn lock(self) -> MutexGuard<'a, T>
Get an accessor to the mutex when the mutex is available
Through the crate::thread::ValueInThread, this is already guaranteed to run in a thread context, so no additional check is performed.
Trait Implementations§
source§impl<T: Clone> Clone for ValueInThread<T>
impl<T: Clone> Clone for ValueInThread<T>
source§fn clone(&self) -> ValueInThread<T>
fn clone(&self) -> ValueInThread<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Deref for ValueInThread<T>
impl<T> Deref for ValueInThread<T>
source§impl<T> DerefMut for ValueInThread<T>
impl<T> DerefMut for ValueInThread<T>
impl<T: Copy> Copy for ValueInThread<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for ValueInThread<T>where
T: RefUnwindSafe,
impl<T> !Send for ValueInThread<T>
impl<T> !Sync for ValueInThread<T>
impl<T> Unpin for ValueInThread<T>where
T: Unpin,
impl<T> UnwindSafe for ValueInThread<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