pub struct RcuOptionCell<T: Send + Sync + 'static> { /* private fields */ }Expand description
An RCU (Read-Copy-Update) version of Cell<Option<T>>.
This Cell can be read from multiple threads concurrently without blocking. When the Cell is written, reads may continue to see the old value of the Cell for some period of time.
Implementations§
Source§impl<T: Send + Sync + 'static> RcuOptionCell<T>
impl<T: Send + Sync + 'static> RcuOptionCell<T>
Sourcepub fn read(&self) -> Option<RcuReadGuard<T>>
pub fn read(&self) -> Option<RcuReadGuard<T>>
Read the value of the RCU Cell.
The object referenced by the RCU Cell will remain valid until the RcuReadGuard is dropped.
However, another thread running concurrently might see a different value for the object.
Sourcepub fn as_ref<'a>(&self, scope: &'a RcuReadScope) -> Option<&'a T>
pub fn as_ref<'a>(&self, scope: &'a RcuReadScope) -> Option<&'a T>
Returns a reference to the value of the RCU Cell.
The object referenced by the RCU Cell will remain valid until the RcuReadGuard is dropped.
However, another thread running concurrently might see a different value for the object.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RcuOptionCell<T>
impl<T> RefUnwindSafe for RcuOptionCell<T>
impl<T> Send for RcuOptionCell<T>
impl<T> Sync for RcuOptionCell<T>
impl<T> Unpin for RcuOptionCell<T>
impl<T> UnwindSafe for RcuOptionCell<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