pub struct VmTimeKeeper { /* private fields */ }
Expand description
A time keeper, which tracks the current time and all waiters.
Implementations§
Source§impl VmTimeKeeper
impl VmTimeKeeper
Sourcepub fn new(driver: &impl SpawnDriver, uptime: VmTime) -> Self
pub fn new(driver: &impl SpawnDriver, uptime: VmTime) -> Self
Creates a new time keeper with the specified current guest time.
Sourcepub fn save(&self) -> SavedState
pub fn save(&self) -> SavedState
Saves the time state.
Sourcepub async fn restore(&mut self, state: SavedState)
pub async fn restore(&mut self, state: SavedState)
Restores the time state.
Sourcepub fn builder(&self) -> &VmTimeSourceBuilder
pub fn builder(&self) -> &VmTimeSourceBuilder
Returns a time source builder, which can be used to spawn tasks that
back VmTimeSource
instances, all backed by this time keeper’s clock.
Trait Implementations§
Source§impl Debug for VmTimeKeeper
impl Debug for VmTimeKeeper
Source§impl InspectMut for VmTimeKeeper
impl InspectMut for VmTimeKeeper
Source§fn inspect_mut(&mut self, req: Request<'_>)
fn inspect_mut(&mut self, req: Request<'_>)
Inspects the object.
Auto Trait Implementations§
impl Freeze for VmTimeKeeper
impl !RefUnwindSafe for VmTimeKeeper
impl Send for VmTimeKeeper
impl Sync for VmTimeKeeper
impl Unpin for VmTimeKeeper
impl !UnwindSafe for VmTimeKeeper
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