Skip to main content

financial_api/fund/
financials.rs

1use crate::endpoints;
2use crate::{
3    Client, Error, FundBalanceSheetsData, FundFinancialIndicatorsData, FundIncomeStatementsData,
4    FundType, Response, Thscode, ValidationError,
5};
6
7impl Client {
8    /// 获取基金财务指标。
9    ///
10    /// # 示例
11    #[doc = concat!(
12        "```no_run\n",
13        include_str!("../../examples/fund_financials_indicators.rs"),
14        "\n```"
15    )]
16    pub async fn fund_financials_indicators(
17        &self,
18        fund_type: FundType,
19        thscode: impl TryInto<Thscode, Error: Into<ValidationError>>,
20    ) -> Result<Response<FundFinancialIndicatorsData>, Error> {
21        self.fund_detail(endpoints::FUND_INDICATORS, fund_type, thscode)
22            .await
23    }
24
25    /// 获取基金利润表。
26    ///
27    /// # 示例
28    #[doc = concat!(
29        "```no_run\n",
30        include_str!("../../examples/fund_financials_income_statements.rs"),
31        "\n```"
32    )]
33    pub async fn fund_financials_income_statements(
34        &self,
35        fund_type: FundType,
36        thscode: impl TryInto<Thscode, Error: Into<ValidationError>>,
37    ) -> Result<Response<FundIncomeStatementsData>, Error> {
38        self.fund_detail(endpoints::FUND_INCOME_STATEMENTS, fund_type, thscode)
39            .await
40    }
41
42    /// 获取基金资产负债表。
43    ///
44    /// # 示例
45    #[doc = concat!(
46        "```no_run\n",
47        include_str!("../../examples/fund_financials_balance_sheets.rs"),
48        "\n```"
49    )]
50    pub async fn fund_financials_balance_sheets(
51        &self,
52        fund_type: FundType,
53        thscode: impl TryInto<Thscode, Error: Into<ValidationError>>,
54    ) -> Result<Response<FundBalanceSheetsData>, Error> {
55        self.fund_detail(endpoints::FUND_BALANCE_SHEETS, fund_type, thscode)
56            .await
57    }
58}