longport/trade/requests/
get_today_executions.rs

1use serde::Serialize;
2
3/// Options for get today executions request
4#[derive(Debug, Default, Serialize, Clone)]
5pub struct GetTodayExecutionsOptions {
6    #[serde(skip_serializing_if = "Option::is_none")]
7    symbol: Option<String>,
8    #[serde(skip_serializing_if = "Option::is_none")]
9    order_id: Option<String>,
10}
11
12impl GetTodayExecutionsOptions {
13    /// Create a new `GetTodayExecutionsOptions`
14    #[inline]
15    pub fn new() -> Self {
16        Default::default()
17    }
18
19    /// Set the security symbol
20    #[inline]
21    #[must_use]
22    pub fn symbol(self, symbol: impl Into<String>) -> Self {
23        Self {
24            symbol: Some(symbol.into()),
25            ..self
26        }
27    }
28
29    /// Set the order id
30    #[inline]
31    #[must_use]
32    pub fn order_id(self, order_id: impl Into<String>) -> Self {
33        Self {
34            order_id: Some(order_id.into()),
35            ..self
36        }
37    }
38}