pub struct ClockSource { /* private fields */ }Expand description
A deterministic clock source for simulation and testing.
Implementations§
Source§impl ClockSource
impl ClockSource
pub fn new() -> Self
pub fn with_delta(delta: f64) -> Self
pub fn advance(&mut self)
pub fn advance_by(&mut self, dt: f64)
pub fn time(&self) -> f64
pub fn delta(&self) -> f64
pub fn frame(&self) -> u64
pub fn set_speed(&mut self, speed: f64)
pub fn speed(&self) -> f64
pub fn pause(&mut self)
pub fn resume(&mut self)
pub fn is_paused(&self) -> bool
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for ClockSource
impl Clone for ClockSource
Source§fn clone(&self) -> ClockSource
fn clone(&self) -> ClockSource
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 ClockSource
impl Debug for ClockSource
Source§impl Default for ClockSource
impl Default for ClockSource
impl Copy for ClockSource
Auto Trait Implementations§
impl Freeze for ClockSource
impl RefUnwindSafe for ClockSource
impl Send for ClockSource
impl Sync for ClockSource
impl Unpin for ClockSource
impl UnsafeUnpin for ClockSource
impl UnwindSafe for ClockSource
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