cloud_hypervisor_client/models/
rate_limiter_config.rs

1/*
2 * Cloud Hypervisor API
3 *
4 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
5 *
6 * The version of the OpenAPI document: 0.3.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// 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.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RateLimiterConfig {
17    #[serde(rename = "bandwidth", skip_serializing_if = "Option::is_none")]
18    pub bandwidth: Option<models::TokenBucket>,
19    #[serde(rename = "ops", skip_serializing_if = "Option::is_none")]
20    pub ops: Option<models::TokenBucket>,
21}
22
23impl RateLimiterConfig {
24    /// 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.
25    pub fn new() -> RateLimiterConfig {
26        RateLimiterConfig {
27            bandwidth: None,
28            ops: None,
29        }
30    }
31}