pub struct GuardRegistration<'a, T> { /* private fields */ }Expand description
Safe api for creating self reference between a pinned ValueGuard and
RefGuard pair.
This can be acquired with
ValueGuard::registration().
Implementations§
Source§impl<'a, T> GuardRegistration<'a, T>
impl<'a, T> GuardRegistration<'a, T>
Sourcepub fn register(self, slot: Pin<&'a RefGuard<T>>)
pub fn register(self, slot: Pin<&'a RefGuard<T>>)
Binds a provided slot to the self.value_guard.
This means they will reference each other, and will invalidate their references to each other when dropped.
This method also invalidates the existing references held by the
now-replaced referencees of slot and self.value_guard to avoid
dangling pointers.
Auto Trait Implementations§
impl<'a, T> Freeze for GuardRegistration<'a, T>
impl<'a, T> !RefUnwindSafe for GuardRegistration<'a, T>
impl<'a, T> !Send for GuardRegistration<'a, T>
impl<'a, T> !Sync for GuardRegistration<'a, T>
impl<'a, T> Unpin for GuardRegistration<'a, T>
impl<'a, T> UnsafeUnpin for GuardRegistration<'a, T>
impl<'a, T> !UnwindSafe for GuardRegistration<'a, T>
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