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§fn protect<T>(&self, ptr: &AtomicPtr<T>, _: Ordering) -> *mut Twhere
T: AsLink,
fn protect<T>(&self, ptr: &AtomicPtr<T>, _: Ordering) -> *mut Twhere
T: AsLink,
Protects the load of an atomic pointer.
Source§unsafe fn defer_retire<T>(&self, ptr: *mut T, reclaim: unsafe fn(_: *mut Link))where
T: AsLink,
unsafe fn defer_retire<T>(&self, ptr: *mut T, reclaim: unsafe fn(_: *mut Link))where
T: AsLink,
Retires a value, running reclaim
when no threads hold a reference to
it.
Source§fn belongs_to(&self, collector: &Collector) -> bool
fn belongs_to(&self, collector: &Collector) -> bool
Returns true
if this guard belongs to the given collector.
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