Skip to main content

Hypervisor

Trait Hypervisor 

Source
pub trait Hypervisor:
    Send
    + Sync
    + 'static {
    type Vm: VirtualMachine;

    // Required methods
    fn capabilities(&self) -> &PlatformCapabilities;
    fn create_vm(&self, config: VmConfig) -> Result<Self::Vm, HypervisorError>;
}
Expand description

Main hypervisor trait for creating and managing virtual machines.

Each platform (macOS, Linux) provides its own implementation.

Required Associated Types§

Source

type Vm: VirtualMachine

The virtual machine type created by this hypervisor.

Required Methods§

Source

fn capabilities(&self) -> &PlatformCapabilities

Returns the platform capabilities.

Source

fn create_vm(&self, config: VmConfig) -> Result<Self::Vm, HypervisorError>

Creates a new virtual machine with the given configuration.

§Errors

Returns an error if the VM cannot be created.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§