pub struct OwnershipAnchor { /* private fields */ }Expand description
Shared lifetime token for native resources that must not outlive an external owner.
Cloning the token extends the owner’s lifetime. The owned value is released only after the final token is dropped, allowing layered providers to carry a process-local ownership gate alongside every independently cloned native handle.
Implementations§
Source§impl OwnershipAnchor
impl OwnershipAnchor
Sourcepub fn new(owner: impl Send + Sync + 'static) -> Self
pub fn new(owner: impl Send + Sync + 'static) -> Self
Erases and retains one ownership value behind a cloneable lifetime token.
Sourcepub fn release_barrier(&self) -> OwnershipReleaseBarrier
pub fn release_barrier(&self) -> OwnershipReleaseBarrier
Observes the exact boundary at which every clone has released the owner.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OwnershipAnchor
impl !UnwindSafe for OwnershipAnchor
impl Freeze for OwnershipAnchor
impl Send for OwnershipAnchor
impl Sync for OwnershipAnchor
impl Unpin for OwnershipAnchor
impl UnsafeUnpin for OwnershipAnchor
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