pub struct SharedAtomicBool { /* private fields */ }Implementations§
Sourcepub fn create(
path: impl AsRef<Path>,
init: bool,
) -> Result<Self, SharedAtomicError>
pub fn create( path: impl AsRef<Path>, init: bool, ) -> Result<Self, SharedAtomicError>
Obtain the flag at path, initializing it to init if the path
does not yet exist and attaching to it if it does. Attaching
leaves the live value in place, so a racing peer never resets a
flag another process already set.
reset reinitializes.
Sourcepub fn reset(
path: impl AsRef<Path>,
init: bool,
) -> Result<Self, SharedAtomicError>
pub fn reset( path: impl AsRef<Path>, init: bool, ) -> Result<Self, SharedAtomicError>
Truncate the flag at path and initialize it to init,
discarding the value live peers share. For a caller that knows
it owns the path.
pub fn open(path: impl AsRef<Path>) -> Result<Self, SharedAtomicError>
pub fn load(&self, ord: Ordering) -> bool
pub fn store(&self, v: bool, ord: Ordering)
pub fn swap(&self, v: bool, ord: Ordering) -> bool
pub fn flush(&self) -> Result<(), SharedAtomicError>
Sourcepub fn flush_async(&self) -> Result<(), SharedAtomicError>
pub fn flush_async(&self) -> Result<(), SharedAtomicError>
Non-blocking flush: schedules a writeback via the OS. Note: Windows is only partially async (sync to page cache, not to disk).
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