pub trait WaitEffects {
// Required methods
fn lock_present(&mut self) -> Result<bool, String>;
fn gather(&mut self) -> Result<Option<Evidence>, String>;
fn sleep(&mut self, ms: u64);
fn random(&mut self) -> f64;
fn now_ms(&mut self) -> f64;
fn report(&mut self, line: &str);
}Expand description
What:
The side effects of a wait,
injected so tests can drive a fake clock and fake holders.
Why:
The host implementation reads /proc,
sleeps and writes standard error;
tests script each step.
In TS you’d write (pseudocode):
type IndexLockWaitEffects = { gather; sleep; random; report; now };Required Methods§
Sourcefn lock_present(&mut self) -> Result<bool, String>
fn lock_present(&mut self) -> Result<bool, String>
Whether the lock currently exists (the attempt).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".