pub struct HistoricalClock { /* private fields */ }Expand description
A clock that replays historical time by walking through a specified interval.
The clock starts at the interval’s start time and advances in fixed time steps
until reaching the end of the interval. Each call to cycle_time() advances
the clock by one time step.
The instant component is adjusted so that the baseline instant represents the start of the historical interval, maintaining proper duration relationships.
Implementations§
Source§impl HistoricalClock
impl HistoricalClock
Sourcepub fn new(interval: Interval) -> Self
pub fn new(interval: Interval) -> Self
Create a new historical clock with a default 100μs time step
Sourcepub fn with_time_step(interval: Interval, time_step: Duration) -> Self
pub fn with_time_step(interval: Interval, time_step: Duration) -> Self
Create a new historical clock with a custom time step
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Check if the clock has exhausted the historical interval
Sourcepub fn current_time(&self) -> OffsetDateTime
pub fn current_time(&self) -> OffsetDateTime
Get the current position within the interval
Trait Implementations§
Source§impl Clock for HistoricalClock
impl Clock for HistoricalClock
Source§fn cycle_time(&mut self) -> CycleTime
fn cycle_time(&mut self) -> CycleTime
Get the current cycle time containing both monotonic and wall clock times. Read more
Auto Trait Implementations§
impl Freeze for HistoricalClock
impl RefUnwindSafe for HistoricalClock
impl Send for HistoricalClock
impl Sync for HistoricalClock
impl Unpin for HistoricalClock
impl UnwindSafe for HistoricalClock
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