pub trait InstanceControl: VersionInfo {
// Provided methods
fn get_pid(&self) -> Option<u32> { ... }
fn get_pids(&self) -> Vec<u32> { ... }
async fn close_instance(&self, pid: u32) -> InstanceResult<()> { ... }
async fn delete_instance(&self) -> InstanceResult<()> { ... }
fn size_of_instance(&self, version: &Version) -> InstanceSize { ... }
}Expand description
Extension trait providing instance management utilities.
Auto-implemented for every VersionInfo.
Provided Methods§
Sourcefn get_pid(&self) -> Option<u32>
fn get_pid(&self) -> Option<u32>
Returns the first PID of a running instance, or None if not running.
Sourceasync fn close_instance(&self, pid: u32) -> InstanceResult<()>
async fn close_instance(&self, pid: u32) -> InstanceResult<()>
Closes a specific instance by PID.
Sourceasync fn delete_instance(&self) -> InstanceResult<()>
async fn delete_instance(&self) -> InstanceResult<()>
Deletes the instance from disk. Errors if any process is still running.
Sourcefn size_of_instance(&self, version: &Version) -> InstanceSize
fn size_of_instance(&self, version: &Version) -> InstanceSize
Returns the per-component disk-size breakdown from version metadata.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.