binance_client/http_exchange_api_v2/data/products/get/
request.rs

1//!
2//! The products GET request.
3//!
4
5///
6/// The `https://www.binance.com/exchange-api/v2/public/asset-service/product/get-products` GET request query.
7///
8pub struct Query {
9    /// Whether to include ETF.
10    pub include_etf: bool,
11}
12
13impl Query {
14    /// The query params default capacity.
15    const QUERY_INITIAL_CAPACITY: usize = 256;
16
17    ///
18    /// A shortcut constructor.
19    ///
20    pub fn new(include_etf: bool) -> Self {
21        Self { include_etf }
22    }
23}
24
25impl ToString for Query {
26    fn to_string(&self) -> String {
27        let mut params = String::with_capacity(Self::QUERY_INITIAL_CAPACITY);
28        params += &format!("includeEtf={}", self.include_etf);
29        params
30    }
31}