pub struct SharedCell<T: Copy + 'static> { /* private fields */ }Implementations§
pub fn create(path: impl AsRef<Path>) -> Result<Self, SharedCellError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, SharedCellError>
Sourcepub fn set(&self, value: T)
pub fn set(&self, value: T)
Atomically replace the cell value. SeqLock protocol: odd version during the memcpy, even after.
Sourcepub fn get(&self) -> T
pub fn get(&self) -> T
Read the current value via the SeqLock retry loop. Always returns; the loop is bounded by writer frequency.
pub fn version(&self) -> u32
Sourcepub fn flush_async(&self) -> Result<(), SharedCellError>
pub fn flush_async(&self) -> Result<(), SharedCellError>
Non-blocking flush: schedules a writeback via the OS. Note: Windows is only partially async (sync to page cache, not to disk).
pub fn flush(&self) -> Result<(), SharedCellError>
Trait Implementations§
fn header(&self) -> &HandshakeHeader
fn ring(&self) -> &ObservationRing
fn make_policy(&self) -> Box<dyn Policy>
Source§fn apply_migration(&self, new_tag: u32)
fn apply_migration(&self, new_tag: u32)
Called by the sidecar when the policy returns a new strategy
tag. Default implementation: just set the tag on the header.
Primitives that need heavier migration (data-layout swap)
override this to perform the swap before (or after) updating
the tag.
Auto Trait Implementations§
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