pub struct SharedGuard<'a, T> { /* private fields */ }Expand description
A guard that releases a shared reference when dropped.
Implementations§
Sourcepub fn new(data: &'a T, borrow: &'a AtomicBorrow) -> Self
pub fn new(data: &'a T, borrow: &'a AtomicBorrow) -> Self
Creates a new SharedGuard.
Sourcepub unsafe fn try_new(data: *const T, borrow: &'a AtomicBorrow) -> Option<Self>
pub unsafe fn try_new(data: *const 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: *const T, borrow: &'a AtomicBorrow) -> Self
pub unsafe fn spin(data: *const 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§
Auto Trait Implementations§
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