pub struct LocalGuard<'a> { /* private fields */ }
Expand description
A guard that keeps the current thread marked as active.
Local guards are created by calling Collector::enter
. Unlike
OwnedGuard
, a local guard is tied to the current thread and does not
implement Send
. This makes local guards relatively cheap to create and
destroy.
Most of the functionality provided by this type is through the Guard
trait.
Trait Implementations§
Source§impl Debug for LocalGuard<'_>
impl Debug for LocalGuard<'_>
Source§impl Drop for LocalGuard<'_>
impl Drop for LocalGuard<'_>
Source§impl Guard for LocalGuard<'_>
impl Guard for LocalGuard<'_>
Source§unsafe fn defer_retire<T>(
&self,
ptr: *mut T,
reclaim: unsafe fn(*mut T, &Collector),
)
unsafe fn defer_retire<T>( &self, ptr: *mut T, reclaim: unsafe fn(*mut T, &Collector), )
Retires a value, running reclaim
when no threads hold a reference to
it.
Source§fn protect<T>(&self, ptr: &AtomicPtr<T>, order: Ordering) -> *mut T
fn protect<T>(&self, ptr: &AtomicPtr<T>, order: Ordering) -> *mut T
Protects the load of an atomic pointer. Read more
Source§fn swap<T>(&self, ptr: &AtomicPtr<T>, value: *mut T, order: Ordering) -> *mut T
fn swap<T>(&self, ptr: &AtomicPtr<T>, value: *mut T, order: Ordering) -> *mut T
Stores a value into the pointer, returning the protected previous value. Read more
Auto Trait Implementations§
impl<'a> Freeze for LocalGuard<'a>
impl<'a> !RefUnwindSafe for LocalGuard<'a>
impl<'a> !Send for LocalGuard<'a>
impl<'a> !Sync for LocalGuard<'a>
impl<'a> Unpin for LocalGuard<'a>
impl<'a> !UnwindSafe for LocalGuard<'a>
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