Struct seize::LocalGuard
source · 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: AsLink>(&self, ptr: &AtomicPtr<T>, ordering: Ordering) -> *mut T
fn protect<T: AsLink>(&self, ptr: &AtomicPtr<T>, ordering: Ordering) -> *mut T
Protects the load of an atomic pointer.
source§unsafe fn defer_retire<T: AsLink>(
&self,
ptr: *mut T,
reclaim: unsafe fn(_: *mut Link)
)
unsafe fn defer_retire<T: AsLink>( &self, ptr: *mut T, reclaim: unsafe fn(_: *mut Link) )
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