pub struct ShimHandler { /* private fields */ }Expand description
Handler for a running VM subprocess (shim process).
Provides lifecycle operations (stop, metrics, status) for a VM identified by PID.
Implementations§
Source§impl ShimHandler
impl ShimHandler
Sourcepub fn from_child(process: Child, box_id: String) -> Self
pub fn from_child(process: Child, box_id: String) -> Self
Create a handler for a spawned VM with process ownership.
This constructor takes ownership of the Child process handle for proper lifecycle management (clean shutdown with wait()).
Trait Implementations§
Source§impl VmHandler for ShimHandler
impl VmHandler for ShimHandler
Source§fn stop(&mut self, signal: i32, timeout_ms: u64) -> Result<()>
fn stop(&mut self, signal: i32, timeout_ms: u64) -> Result<()>
Stop the VM. Sends
signal first, then SIGKILL after timeout_ms.Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the VM process is still alive.
Source§fn exit_code(&self) -> Option<i32>
fn exit_code(&self) -> Option<i32>
Return the exit code of the VM process, if it has exited. Read more
Source§fn try_wait_exit(&mut self) -> Result<Option<i32>>
fn try_wait_exit(&mut self) -> Result<Option<i32>>
Poll the VM process for natural exit without sending any signal. Read more
Source§fn has_exited(&self) -> bool
fn has_exited(&self) -> bool
Whether the VM process has exited, treating a zombie (an exited child not
yet reaped by its parent) as exited. Read more
Auto Trait Implementations§
impl !Freeze for ShimHandler
impl RefUnwindSafe for ShimHandler
impl Send for ShimHandler
impl Sync for ShimHandler
impl Unpin for ShimHandler
impl UnsafeUnpin for ShimHandler
impl UnwindSafe for ShimHandler
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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