cloud-hypervisor-client 0.4.0+api-spec-0.3.0-2026-05-04

Unofficial Rust crate for accessing the cloud-hypervisor REST API.
Documentation
/*
 * Cloud Hypervisor API
 *
 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
 *
 * The version of the OpenAPI document: 0.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// VmInfo : Virtual Machine information
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VmInfo {
    #[serde(rename = "config")]
    pub config: models::VmConfig,
    #[serde(rename = "state")]
    pub state: models::VmState,
    #[serde(rename = "memory_actual_size", skip_serializing_if = "Option::is_none")]
    pub memory_actual_size: Option<i64>,
    #[serde(rename = "device_tree", skip_serializing_if = "Option::is_none")]
    pub device_tree: Option<std::collections::HashMap<String, models::DeviceNode>>,
}

impl VmInfo {
    /// Virtual Machine information
    pub fn new(config: models::VmConfig, state: models::VmState) -> VmInfo {
        VmInfo {
            config,
            state,
            memory_actual_size: None,
            device_tree: None,
        }
    }
}