firepilot_models/models/rate_limiter.rs
1/*
2 * Firecracker API
3 *
4 * RESTful public-facing API. The API is accessible through HTTP calls on specific URLs carrying JSON modeled data. The transport medium is a Unix Domain Socket.
5 *
6 * The version of the OpenAPI document: 1.3.0
7 * Contact: compute-capsule@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// RateLimiter : 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.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct RateLimiter {
15 #[serde(rename = "bandwidth", skip_serializing_if = "Option::is_none")]
16 pub bandwidth: Option<Box<crate::models::TokenBucket>>,
17 #[serde(rename = "ops", skip_serializing_if = "Option::is_none")]
18 pub ops: Option<Box<crate::models::TokenBucket>>,
19}
20
21impl RateLimiter {
22 /// 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.
23 pub fn new() -> RateLimiter {
24 RateLimiter {
25 bandwidth: None,
26 ops: None,
27 }
28 }
29}