pub struct RcuWeak<T: Send + Sync + 'static> { /* private fields */ }Expand description
An RCU (Read-Copy-Update) wrapper around a Weak pointer.
The weak pointer can be read and upgraded from multiple threads concurrently without blocking. When the weak pointer is replaced, reads may continue to see the old weak pointer for some period of time.
Implementations§
Source§impl<T: Send + Sync + 'static> RcuWeak<T>
impl<T: Send + Sync + 'static> RcuWeak<T>
Sourcepub fn to_weak(&self) -> Weak<T>
pub fn to_weak(&self) -> Weak<T>
Create a new Weak pointer to the object referenced by the wrapped Weak pointer.
Sourcepub fn ptr_eq(&self, other: &Weak<T>) -> bool
pub fn ptr_eq(&self, other: &Weak<T>) -> bool
Check if the wrapped weak pointer points to the same allocation as other.
Sourcepub fn update(&self, data: Weak<T>)
pub fn update(&self, data: Weak<T>)
Write a new Weak pointer to the RCU wrapper.
Concurrent readers may continue to see the old weak pointer until the RCU state machine has made sufficient progress to ensure that no concurrent readers are holding read guards.
Sourcepub fn strong_count(&self, scope: &RcuReadScope) -> usize
pub fn strong_count(&self, scope: &RcuReadScope) -> usize
Gets the number of strong (Arc) pointers pointing to the allocation.
Trait Implementations§
impl<T: Send + Sync + 'static> RcuDroppable for RcuWeak<T>
Auto Trait Implementations§
impl<T> !Freeze for RcuWeak<T>
impl<T> RefUnwindSafe for RcuWeak<T>
impl<T> Send for RcuWeak<T>
impl<T> Sync for RcuWeak<T>
impl<T> Unpin for RcuWeak<T>
impl<T> UnsafeUnpin for RcuWeak<T>
impl<T> UnwindSafe for RcuWeak<T>where
T: RefUnwindSafe,
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