pub struct FundContext(/* private fields */);Expand description
Fund (mutual fund) channel context.
Implementations§
Source§impl FundContext
impl FundContext
Sourcepub fn new(config: Arc<Config>) -> Self
pub fn new(config: Arc<Config>) -> Self
Create a FundContext
Sourcepub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
pub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
Returns the log subscriber
Sourcepub async fn funds(
&self,
options: impl Into<Option<GetFundsOptions>>,
) -> Result<Vec<FundBrief>>
pub async fn funds( &self, options: impl Into<Option<GetFundsOptions>>, ) -> Result<Vec<FundBrief>>
Get the fund list.
Sourcepub async fn filters(&self) -> Result<FundFilters>
pub async fn filters(&self) -> Result<FundFilters>
Get the fund list filter options.
Sourcepub async fn detail(&self, counter_id: impl Into<String>) -> Result<FundDetail>
pub async fn detail(&self, counter_id: impl Into<String>) -> Result<FundDetail>
Get fund detail.
Sourcepub async fn analysis(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundAnalysisOptions>>,
) -> Result<FundAnalysis>
pub async fn analysis( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundAnalysisOptions>>, ) -> Result<FundAnalysis>
Get fund analysis (level 1).
Sourcepub async fn analysis_detail(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundAnalysisOptions>>,
) -> Result<FundAnalysisDetail>
pub async fn analysis_detail( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundAnalysisOptions>>, ) -> Result<FundAnalysisDetail>
Get fund analysis detail (level 2).
Sourcepub async fn trend(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundAnalysisOptions>>,
) -> Result<FundTrend>
pub async fn trend( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundAnalysisOptions>>, ) -> Result<FundTrend>
Get fund trend chart.
Sourcepub async fn annual_returns(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<FundPageOptions>>,
) -> Result<Vec<FundAnnualReturn>>
pub async fn annual_returns( &self, counter_id: impl Into<String>, options: impl Into<Option<FundPageOptions>>, ) -> Result<Vec<FundAnnualReturn>>
Get fund annual returns.
Sourcepub async fn quarterly_returns(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<FundPageOptions>>,
) -> Result<Vec<FundQuarterlyReturn>>
pub async fn quarterly_returns( &self, counter_id: impl Into<String>, options: impl Into<Option<FundPageOptions>>, ) -> Result<Vec<FundQuarterlyReturn>>
Get fund quarterly returns.
Sourcepub async fn performance(
&self,
counter_id: impl Into<String>,
) -> Result<Vec<FundPerformance>>
pub async fn performance( &self, counter_id: impl Into<String>, ) -> Result<Vec<FundPerformance>>
Get fund performance figures.
Sourcepub async fn performance_comparison(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundAnalysisOptions>>,
) -> Result<FundPerformanceComparison>
pub async fn performance_comparison( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundAnalysisOptions>>, ) -> Result<FundPerformanceComparison>
Get fund performance comparison.
Get fund latest net value.
Get fund historical net value (paged).
Get fund historical net value by relative time range.
Sourcepub async fn holdings(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundHoldingsOptions>>,
) -> Result<FundHoldings>
pub async fn holdings( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundHoldingsOptions>>, ) -> Result<FundHoldings>
Get a fund’s top-10 holdings.
Sourcepub async fn stock_holdings(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundStockHoldingsOptions>>,
) -> Result<Vec<FundStockHolding>>
pub async fn stock_holdings( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundStockHoldingsOptions>>, ) -> Result<Vec<FundStockHolding>>
Get the stocks held by a fund (reverse lookup).
Sourcepub async fn positions(
&self,
options: impl Into<Option<GetFundPositionsOptions>>,
) -> Result<FundPositions>
pub async fn positions( &self, options: impl Into<Option<GetFundPositionsOptions>>, ) -> Result<FundPositions>
Get the user’s fund positions overview.
Sourcepub async fn position(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundPositionOptions>>,
) -> Result<FundPositionDetail>
pub async fn position( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundPositionOptions>>, ) -> Result<FundPositionDetail>
Get the user’s single fund position detail.
Sourcepub async fn position_performance(
&self,
counter_id: impl Into<String>,
) -> Result<Vec<FundPositionPerformance>>
pub async fn position_performance( &self, counter_id: impl Into<String>, ) -> Result<Vec<FundPositionPerformance>>
Get the performance figures of a held fund.
Sourcepub async fn position_profits(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundPositionProfitsOptions>>,
) -> Result<FundPositionProfits>
pub async fn position_profits( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundPositionProfitsOptions>>, ) -> Result<FundPositionProfits>
Get the cumulative-profit series of a held fund.
Get the net-value history of a held fund.
Sourcepub async fn position_dividends(
&self,
counter_id: impl Into<String>,
options: impl Into<Option<GetFundPositionDividendsOptions>>,
) -> Result<FundDividends>
pub async fn position_dividends( &self, counter_id: impl Into<String>, options: impl Into<Option<GetFundPositionDividendsOptions>>, ) -> Result<FundDividends>
Get the dividend records of a held fund.
Sourcepub async fn orders(
&self,
options: impl Into<Option<GetFundOrdersOptions>>,
) -> Result<Vec<FundOrder>>
pub async fn orders( &self, options: impl Into<Option<GetFundOrdersOptions>>, ) -> Result<Vec<FundOrder>>
Get the user’s fund orders (also serves as the trade/execution record).
Sourcepub async fn order(&self, order_id: i64) -> Result<FundOrderDetail>
pub async fn order(&self, order_id: i64) -> Result<FundOrderDetail>
Get a fund order detail.
Sourcepub async fn transactions(
&self,
options: impl Into<Option<GetFundTransactionsOptions>>,
) -> Result<Vec<FundTransaction>>
pub async fn transactions( &self, options: impl Into<Option<GetFundTransactionsOptions>>, ) -> Result<Vec<FundTransaction>>
Get the user’s fund transactions (cash-flow records).
Sourcepub async fn validate_order(
&self,
options: ValidateFundOrderOptions,
) -> Result<FundOrderValidation>
pub async fn validate_order( &self, options: ValidateFundOrderOptions, ) -> Result<FundOrderValidation>
Validate a fund order before submitting.
Sourcepub async fn submit_order(
&self,
options: SubmitFundOrderOptions,
) -> Result<FundOrderSubmitResponse>
pub async fn submit_order( &self, options: SubmitFundOrderOptions, ) -> Result<FundOrderSubmitResponse>
Submit a fund order (buy / sell).
Sourcepub async fn cancel_order(&self, order_id: i64) -> Result<()>
pub async fn cancel_order(&self, order_id: i64) -> Result<()>
Cancel (withdraw) a fund order.
Trait Implementations§
Source§impl Clone for FundContext
impl Clone for FundContext
Source§fn clone(&self) -> FundContext
fn clone(&self) -> FundContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FundContext
impl !UnwindSafe for FundContext
impl Freeze for FundContext
impl Send for FundContext
impl Sync for FundContext
impl Unpin for FundContext
impl UnsafeUnpin for FundContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more