pub struct RcuOptionBox<T: RcuDroppable + Sync> { /* private fields */ }Expand description
An RCU (Read-Copy-Update) wrapper around Option<Box>.
The Box can be dereferenced from multiple threads concurrently without blocking. When the Box is replaced, reads may continue to see the old Box for some period of time.
Implementations§
Source§impl<T: RcuDroppable + Sync> RcuOptionBox<T>
impl<T: RcuDroppable + Sync> RcuOptionBox<T>
Sourcepub fn read(&self) -> Option<RcuReadGuard<T>>
pub fn read(&self) -> Option<RcuReadGuard<T>>
Read the value of the wrapped Box, if present.
The object referenced by the Box will remain valid until the RcuReadGuard is dropped.
However, another thread running concurrently might see a different 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 wrapped Box, if present.
The object referenced by the Box will remain valid until the RcuReadScope is dropped.
However, another thread running concurrently might see a different object.
Sourcepub fn is_some(&self, scope: &RcuReadScope) -> bool
pub fn is_some(&self, scope: &RcuReadScope) -> bool
Returns true if the RCU wrapper currently contains a value.
Sourcepub fn is_none(&self, scope: &RcuReadScope) -> bool
pub fn is_none(&self, scope: &RcuReadScope) -> bool
Returns true if the RCU wrapper does not contain a value.