pub trait VmQuery:
Send
+ Sync
+ 'static {
// Required methods
fn list_vms(&self) -> VmRuntimeResult<Vec<VmView>>;
fn get_vm(&self, vm_id: &str) -> VmRuntimeResult<Option<VmView>>;
fn list_snapshots(
&self,
vm_id: &str,
) -> VmRuntimeResult<Option<Vec<String>>>;
}Expand description
Read-only queries against microVM state, used by query surfaces.
Required Methods§
Sourcefn list_vms(&self) -> VmRuntimeResult<Vec<VmView>>
fn list_vms(&self) -> VmRuntimeResult<Vec<VmView>>
Return all known VMs, sorted by identifier.
Sourcefn get_vm(&self, vm_id: &str) -> VmRuntimeResult<Option<VmView>>
fn get_vm(&self, vm_id: &str) -> VmRuntimeResult<Option<VmView>>
Return a single VM by identifier, or None if it does not exist.
Sourcefn list_snapshots(&self, vm_id: &str) -> VmRuntimeResult<Option<Vec<String>>>
fn list_snapshots(&self, vm_id: &str) -> VmRuntimeResult<Option<Vec<String>>>
Return the snapshot names for a VM, or None if the VM does not exist.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".