pub struct PauseController { /* private fields */ }Expand description
Whole-VM time-stop controller backed by Wasmtime epoch_interruption and paused guest clock accounting.
Implementations§
Source§impl PauseController
impl PauseController
pub fn new(engine: Engine) -> Arc<Self> ⓘ
pub fn is_paused(&self) -> bool
Sourcepub fn pause(&self) -> bool
pub fn pause(&self) -> bool
Increment pause refcount and interrupt all running Wasmtime kthreads immediately.
Returns true if this call transitioned the VM from running -> paused.
Sourcepub fn resume(&self) -> Option<u64>
pub fn resume(&self) -> Option<u64>
Decrement pause refcount; resumes the VM when count reaches 0.
Returns Some(paused_ms) if this call transitioned paused -> running.
Sourcepub fn paused_ns(&self) -> u64
pub fn paused_ns(&self) -> u64
Total nanoseconds the VM has spent frozen (including any currently active freeze).
Sourcepub fn wait_if_paused(&self) -> bool
pub fn wait_if_paused(&self) -> bool
Block the calling kthread while the VM is frozen. Returns false if aborted/exited.
Auto Trait Implementations§
impl !Freeze for PauseController
impl !RefUnwindSafe for PauseController
impl !UnwindSafe for PauseController
impl Forget for PauseController
impl Move for PauseController
impl Send for PauseController
impl Sync for PauseController
impl Unpin for PauseController
impl UnsafeUnpin for PauseControllerwhere
*const ArcInner<EngineInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<EngineInner>>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
Align8<u64>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more