binance_client/http_api_v3/data/depth/get/
request.rs1pub struct Query {
9 pub symbol: String,
11 pub limit: Option<i64>,
13}
14
15impl Query {
16 const QUERY_INITIAL_CAPACITY: usize = 256;
18
19 pub fn new(symbol: &str, limit: Option<i64>) -> Self {
23 Self {
24 symbol: symbol.to_owned(),
25 limit,
26 }
27 }
28}
29
30impl ToString for Query {
31 fn to_string(&self) -> String {
32 let mut params = String::with_capacity(Self::QUERY_INITIAL_CAPACITY);
33 params += &format!("symbol={}", self.symbol.to_owned());
34 if let Some(limit) = self.limit {
35 params += &format!("&limit={}", limit);
36 }
37 params
38 }
39}