Struct read_copy_update::Rcu
source · pub struct Rcu<T> { /* private fields */ }
Expand description
Represents a read-copy-update for a specific value.
This is the write side, new read handles can be constructed by calling Rcu::reader
.
Implementations§
source§impl<T: 'static> Rcu<T>
impl<T: 'static> Rcu<T>
sourcepub fn write(&mut self, value: T)
pub fn write(&mut self, value: T)
Write a new value making it available to all readers.
Previously written values will be reclaimed when they are no longer accesed.
sourcepub fn try_reclaim(&mut self) -> usize
pub fn try_reclaim(&mut self) -> usize
Try and reclaim any values which are no longer in-use.
Returns the number of values still waiting to be reclaimed.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Rcu<T>
impl<T> Send for Rcu<T>where
T: Send,
impl<T> Sync for Rcu<T>where
T: Send,
impl<T> Unpin for Rcu<T>
impl<T> UnwindSafe for Rcu<T>
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