pub struct VirtualClock { /* private fields */ }
Expand description
Virtual clock that can be manipulated for testing time-dependent behavior
Implementations§
Source§impl VirtualClock
impl VirtualClock
Sourcepub fn new_at(time: DateTime<Utc>) -> Self
pub fn new_at(time: DateTime<Utc>) -> Self
Create a new virtual clock with time travel enabled at a specific time
Sourcepub fn enable_and_set(&self, time: DateTime<Utc>)
pub fn enable_and_set(&self, time: DateTime<Utc>)
Enable time travel and set the current virtual time
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if time travel is enabled
Sourcepub fn set_scale(&self, factor: f64)
pub fn set_scale(&self, factor: f64)
Set the time scale factor (1.0 = real time, 2.0 = 2x speed, etc.)
Sourcepub fn status(&self) -> TimeTravelStatus
pub fn status(&self) -> TimeTravelStatus
Get time travel status
Trait Implementations§
Source§impl Clone for VirtualClock
impl Clone for VirtualClock
Source§fn clone(&self) -> VirtualClock
fn clone(&self) -> VirtualClock
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 moreSource§impl Debug for VirtualClock
impl Debug for VirtualClock
Auto Trait Implementations§
impl Freeze for VirtualClock
impl RefUnwindSafe for VirtualClock
impl Send for VirtualClock
impl Sync for VirtualClock
impl Unpin for VirtualClock
impl UnwindSafe for VirtualClock
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