pub struct ShimHandler { /* private fields */ }Expand description
Runtime handler for a running VM subprocess.
Provides lifecycle operations (stop, metrics, status) for a VM identified by PID. Works for both spawned VMs and reconnected VMs (same operations).
Implementations§
Source§impl ShimHandler
impl ShimHandler
Sourcepub fn from_spawned(spawned: SpawnedShim, box_id: BoxID) -> Self
pub fn from_spawned(spawned: SpawnedShim, box_id: BoxID) -> Self
Create a handler from a spawned shim.
Takes ownership of the SpawnedShim (child process + keepalive) for
proper lifecycle management. The keepalive keeps the watchdog pipe
alive; dropping it triggers shim shutdown.
Sourcepub fn from_pid(pid: u32, box_id: BoxID) -> Self
pub fn from_pid(pid: u32, box_id: BoxID) -> Self
Create a handler for an existing VM (attach mode).
Used when reconnecting to a running box. We don’t have a Child handle or keepalive, so we manage the process by PID only.
§Arguments
pid- Process ID of the running VMbox_id- Box identifier (for logging)
Trait Implementations§
Source§impl VmmHandler for ShimHandler
impl VmmHandler for ShimHandler
Source§fn stop(&mut self) -> BoxliteResult<()>
fn stop(&mut self) -> BoxliteResult<()>
Stop the VM.
Source§fn metrics(&self) -> BoxliteResult<VmmMetrics>
fn metrics(&self) -> BoxliteResult<VmmMetrics>
Get VM metrics (CPU, memory, disk usage).
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the VM is still running.
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request