pub struct Exclusive<T: ?Sized> { /* private fields */ }Expand description
A value reachable only through exclusive access, which makes the wrapper Sync whatever
the value is.
Every accessor takes &mut self or self, so a shared reference to the wrapper cannot reach
the value. That is all Sync requires, which lets a value that is Send but not Sync,
such as a boxed future, live in a type that must be Sync.
Implementations§
Source§impl<T> Exclusive<T>
impl<T> Exclusive<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap the value.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Exclusive<T>
impl<T> RefUnwindSafe for Exclusive<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Exclusive<T>
impl<T> Unpin for Exclusive<T>
impl<T> UnsafeUnpin for Exclusive<T>where
T: UnsafeUnpin + ?Sized,
impl<T> UnwindSafe for Exclusive<T>where
T: UnwindSafe + ?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