#[non_exhaustive]pub struct ServiceClock { /* private fields */ }Expand description
A clock supplied to RustiaBuilder::wall_clock or
RustiaBuilder::monotonic_clock.
Every constructor declares whether readings repeat during replay.
Profile::DeterministicSim rejects nondeterministic providers when built;
other profiles accept either kind.
Cloning shares the underlying provider.
Implementations§
Source§impl ServiceClock
impl ServiceClock
Sourcepub fn system() -> Self
pub fn system() -> Self
Real system time in seconds since the Unix epoch, anchored to a monotonic instant at
construction so readings never move backwards. Labeled nondeterministic: usable on
ReproducibleStandard/LuauCompat, rejected on DeterministicSim.
Sourcepub fn fixed(t: f64) -> Self
pub fn fixed(t: f64) -> Self
Constant clock that always reads t seconds. Labeled deterministic.
Sourcepub fn from_fn(clock: impl FnMut() -> f64 + 'static) -> Self
pub fn from_fn(clock: impl FnMut() -> f64 + 'static) -> Self
Supplies a clock whose readings the host promises to reproduce during replay. Rustia trusts this declaration and does not verify it.
Sourcepub fn from_nondeterministic_fn(clock: impl FnMut() -> f64 + 'static) -> Self
pub fn from_nondeterministic_fn(clock: impl FnMut() -> f64 + 'static) -> Self
Host-supplied live clock. The provider is explicitly labeled nondeterministic.
Trait Implementations§
Source§impl Clone for ServiceClock
impl Clone for ServiceClock
Source§fn clone(&self) -> ServiceClock
fn clone(&self) -> ServiceClock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more