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};

/// RateLimiterConfig : Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RateLimiterConfig {
    #[serde(rename = "bandwidth", skip_serializing_if = "Option::is_none")]
    pub bandwidth: Option<models::TokenBucket>,
    #[serde(rename = "ops", skip_serializing_if = "Option::is_none")]
    pub ops: Option<models::TokenBucket>,
}

impl RateLimiterConfig {
    /// Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
    pub fn new() -> RateLimiterConfig {
        RateLimiterConfig {
            bandwidth: None,
            ops: None,
        }
    }
}