Skip to main content

VmQuery

Trait VmQuery 

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

Source

fn list_vms(&self) -> VmRuntimeResult<Vec<VmView>>

Return all known VMs, sorted by identifier.

Source

fn get_vm(&self, vm_id: &str) -> VmRuntimeResult<Option<VmView>>

Return a single VM by identifier, or None if it does not exist.

Source

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

Implementors§