pub trait VmProvider:
Send
+ Sync
+ 'static {
// Required methods
fn create_vm(&self, vm_id: &str) -> VmRuntimeResult<()>;
fn start_vm(&self, vm_id: &str) -> VmRuntimeResult<()>;
fn stop_vm(&self, vm_id: &str) -> VmRuntimeResult<()>;
fn snapshot_vm(&self, vm_id: &str, snapshot_id: &str) -> VmRuntimeResult<()>;
fn destroy_vm(&self, vm_id: &str) -> VmRuntimeResult<()>;
}Expand description
State-changing operations on microVMs, executed by lifecycle jobs.
Required Methods§
Sourcefn create_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
fn create_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
Provision a new microVM. Fails if vm_id is already in use.
Sourcefn start_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
fn start_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
Start a created or stopped microVM. Fails if already running or destroyed.
Sourcefn stop_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
fn stop_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
Stop a running microVM. Fails if not currently running.
Sourcefn snapshot_vm(&self, vm_id: &str, snapshot_id: &str) -> VmRuntimeResult<()>
fn snapshot_vm(&self, vm_id: &str, snapshot_id: &str) -> VmRuntimeResult<()>
Capture the state of a microVM as a named snapshot. Fails if the VM is destroyed or the snapshot name already exists.
Sourcefn destroy_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
fn destroy_vm(&self, vm_id: &str) -> VmRuntimeResult<()>
Tear down a microVM. Terminal state — cannot be restarted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".