pub struct DeterminismGuard {
pub mode: KernelMode,
}Expand description
Guard that enforces determinism in Replay/Verify mode.
Call DeterminismGuard::check_clock_access, DeterminismGuard::check_random_access, or DeterminismGuard::check_spawn_access before performing the corresponding operation; they return Err in Replay/Verify mode.
Fields§
§mode: KernelModeImplementations§
Source§impl DeterminismGuard
impl DeterminismGuard
pub fn new(mode: KernelMode) -> Self
Sourcepub fn check_clock_access(&self) -> Result<(), KernelError>
pub fn check_clock_access(&self) -> Result<(), KernelError>
Call before reading the system clock. Fails in Replay/Verify.
Sourcepub fn check_random_access(&self) -> Result<(), KernelError>
pub fn check_random_access(&self) -> Result<(), KernelError>
Call before using hardware randomness. Fails in Replay/Verify.
Sourcepub fn check_spawn_access(&self) -> Result<(), KernelError>
pub fn check_spawn_access(&self) -> Result<(), KernelError>
Call before spawning a new thread. Fails in Replay/Verify.
Trait Implementations§
Source§impl Clone for DeterminismGuard
impl Clone for DeterminismGuard
Source§fn clone(&self) -> DeterminismGuard
fn clone(&self) -> DeterminismGuard
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeterminismGuard
impl RefUnwindSafe for DeterminismGuard
impl Send for DeterminismGuard
impl Sync for DeterminismGuard
impl Unpin for DeterminismGuard
impl UnsafeUnpin for DeterminismGuard
impl UnwindSafe for DeterminismGuard
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