Skip to main content

openlimits_binance/model/websocket/
mini_ticker.rs

1use serde::Deserialize;
2use serde::Serialize;
3use rust_decimal::prelude::Decimal;
4use super::shared::string_to_decimal;
5
6/// This struct represents a mini ticker
7#[derive(Debug, Serialize, Deserialize, Clone)]
8#[serde(rename_all = "camelCase")]
9pub struct MiniTicker {
10    #[serde(rename = "e")]
11    pub event_type: String,
12    #[serde(rename = "E")]
13    pub event_time: u64,
14    #[serde(rename = "s")]
15    pub symbol: String,
16    #[serde(rename = "c", with = "string_to_decimal")]
17    pub close: Decimal,
18    #[serde(rename = "o", with = "string_to_decimal")]
19    pub open: Decimal,
20    #[serde(rename = "l", with = "string_to_decimal")]
21    pub low: Decimal,
22    #[serde(rename = "h", with = "string_to_decimal")]
23    pub high: Decimal,
24    #[serde(rename = "v", with = "string_to_decimal")]
25    pub volume: Decimal,
26    #[serde(rename = "q", with = "string_to_decimal")]
27    pub quote_volume: Decimal,
28}