pub trait PowerCmd {
// Required methods
fn start(&self) -> VmResult<()>;
fn stop<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>;
fn hard_stop(&self) -> VmResult<()>;
fn suspend(&self) -> VmResult<()>;
fn resume(&self) -> VmResult<()>;
fn is_running(&self) -> VmResult<bool>;
fn reboot<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>;
fn hard_reboot(&self) -> VmResult<()>;
fn pause(&self) -> VmResult<()>;
fn unpause(&self) -> VmResult<()>;
}Expand description
A trait for managing power state of a VM.
Required Methods§
Sourcefn stop<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>
fn stop<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>
Stops the VM softly and waits for the VM to stop.
This function usually only sends a ACPI shutdown signal, so there is no guarantee that calling this function will shut down the VM.
Sourcefn is_running(&self) -> VmResult<bool>
fn is_running(&self) -> VmResult<bool>
Returns true if the VM is running.
Sourcefn reboot<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>
fn reboot<D: Into<Option<Duration>>>(&self, timeout: D) -> VmResult<()>
Reboots the VM softly and waits for the VM to start.
Sourcefn hard_reboot(&self) -> VmResult<()>
fn hard_reboot(&self) -> VmResult<()>
Reboots the VM hardly and waits for the VM to start.
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.