bybit/models/header.rs
1use crate::prelude::*;
2
3/// Header structure for trade stream responses.
4///
5/// Contains metadata for trade stream API responses, including rate limit information and timestamps. Bots use this to monitor API usage, ensure compliance with rate limits, and track response timing in real-time trading.
6#[derive(Debug, Serialize, Deserialize, Clone)]
7pub struct Header {
8 /// The API rate limit for the endpoint.
9 ///
10 /// Specifies the total number of requests allowed within the rate limit window. Bots use this to manage API request pacing and avoid rate limit errors.
11 #[serde(rename = "X-Bapi-Limit")]
12 pub x_bapi_limit: String,
13
14 /// The current rate limit status.
15 ///
16 /// Indicates the number of remaining requests within the rate limit window. Bots use this to dynamically adjust request frequency to stay within limits.
17 #[serde(rename = "X-Bapi-Limit-Status")]
18 pub x_bapi_limit_status: String,
19
20 /// The timestamp when the rate limit window resets.
21 ///
22 /// Specifies when the rate limit counter will reset, as a string (e.g., "1625097600000"). Bots use this to schedule requests around reset times.
23 #[serde(rename = "X-Bapi-Limit-Reset-Timestamp")]
24 pub x_bapi_limit_reset_timestamp: String,
25
26 /// The unique trace ID for the request.
27 ///
28 /// A unique identifier for tracking the request through Bybit’s system. Bots use this for debugging and correlating requests with responses.
29 #[serde(rename = "Traceid")]
30 pub traceid: String,
31
32 /// The current server timestamp.
33 ///
34 /// The server’s current time, as a string (e.g., "1625097599123"). Bots use this to measure latency and ensure response freshness in real-time trading.
35 #[serde(rename = "Timenow")]
36 pub timenow: String,
37}