pub struct Capsule<T: ?Sized + Sync> { /* private fields */ }Expand description
An encapsulated &T that can be passed between threads.
Since the thread that created it will block until this is dropped, it doesn’t have
a lifetime. However, note that if it isn’t dropped (for example if it is passed to
std::mem::forget) then it can create a deadlock, as the original thread is waiting
for something that will never happen.
Trait Implementations§
impl<T: ?Sized + Sync> Send for Capsule<T>
Auto Trait Implementations§
impl<T> Freeze for Capsule<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Capsule<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Sync for Capsule<T>
impl<T> Unpin for Capsule<T>where
T: ?Sized,
impl<T> UnwindSafe for Capsule<T>where
T: RefUnwindSafe + ?Sized,
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