Skip to main content

InstanceControl

Trait InstanceControl 

Source
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§

Source

fn get_pid(&self) -> Option<u32>

Returns the first PID of a running instance, or None if not running.

Source

fn get_pids(&self) -> Vec<u32>

Returns all PIDs running under this instance name.

Source

async fn close_instance(&self, pid: u32) -> InstanceResult<()>

Closes a specific instance by PID.

Source

async fn delete_instance(&self) -> InstanceResult<()>

Deletes the instance from disk. Errors if any process is still running.

Source

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".

Implementors§