pub struct UniqueGuard<'a, T> { /* private fields */ }Expand description
A guard that releases a unique reference when dropped.
Implementations§
Source§impl<'a, T> UniqueGuard<'a, T>
impl<'a, T> UniqueGuard<'a, T>
Sourcepub fn new(data: &'a mut T, borrow: &'a AtomicBorrow) -> Self
pub fn new(data: &'a mut T, borrow: &'a AtomicBorrow) -> Self
Creates a new UniqueGuard.
Sourcepub unsafe fn try_new(data: *mut T, borrow: &'a AtomicBorrow) -> Option<Self>
pub unsafe fn try_new(data: *mut T, borrow: &'a AtomicBorrow) -> Option<Self>
Tries to borrow the data.
§Safety
- Any borrows of
datamust be registered withborrow. datamust be a valid pointer for the entire lifetime ofself.
Sourcepub unsafe fn spin(data: *mut T, borrow: &'a AtomicBorrow) -> Self
pub unsafe fn spin(data: *mut T, borrow: &'a AtomicBorrow) -> Self
Spins until the data can be borrowed.
§Safety
- Any borrows of
datamust be registered withborrow. datamust be a valid pointer for the entire lifetime ofself.
Sourcepub fn get_borrow(&self) -> &'a AtomicBorrow
pub fn get_borrow(&self) -> &'a AtomicBorrow
Gets the inner AtomicBorrow.
Trait Implementations§
Source§impl<'a, T> Deref for UniqueGuard<'a, T>
impl<'a, T> Deref for UniqueGuard<'a, T>
Source§impl<'a, T> DerefMut for UniqueGuard<'a, T>
impl<'a, T> DerefMut for UniqueGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for UniqueGuard<'a, T>
impl<'a, T> RefUnwindSafe for UniqueGuard<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for UniqueGuard<'a, T>
impl<'a, T> !Sync for UniqueGuard<'a, T>
impl<'a, T> Unpin for UniqueGuard<'a, T>
impl<'a, T> UnwindSafe for UniqueGuard<'a, T>where
T: RefUnwindSafe,
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