longport/trade/requests/
get_fund_positions.rs

1use serde::Serialize;
2
3/// Options for get fund positions request
4#[derive(Debug, Serialize, Default)]
5pub struct GetFundPositionsOptions {
6    #[serde(skip_serializing_if = "<[_]>::is_empty", rename = "symbol")]
7    symbols: Vec<String>,
8}
9
10impl GetFundPositionsOptions {
11    /// Create a new `GetFundPositionsOptions`
12    #[inline]
13    pub fn new() -> Self {
14        Default::default()
15    }
16
17    /// Set the fund symbols
18    #[inline]
19    #[must_use]
20    pub fn symbols<I, T>(self, symbols: I) -> Self
21    where
22        I: IntoIterator<Item = T>,
23        T: Into<String>,
24    {
25        Self {
26            symbols: symbols.into_iter().map(Into::into).collect(),
27        }
28    }
29}