pub struct MarketContext(/* private fields */);Expand description
Market data context — broker holdings, A/H premium, trade statistics, market anomalies, index constituents and more.
Implementations§
Source§impl MarketContext
impl MarketContext
Sourcepub fn new(config: Arc<Config>) -> Self
pub fn new(config: Arc<Config>) -> Self
Create a MarketContext
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 market_status(&self) -> Result<MarketStatusResponse>
pub async fn market_status(&self) -> Result<MarketStatusResponse>
Get current trading status for all markets.
Path: GET /v1/quote/market-status
Sourcepub async fn broker_holding(
&self,
symbol: impl Into<String>,
period: BrokerHoldingPeriod,
) -> Result<BrokerHoldingTop>
pub async fn broker_holding( &self, symbol: impl Into<String>, period: BrokerHoldingPeriod, ) -> Result<BrokerHoldingTop>
Get top broker holdings (buy/sell leaders) for a security.
Path: GET /v1/quote/broker-holding
Sourcepub async fn broker_holding_detail(
&self,
symbol: impl Into<String>,
) -> Result<BrokerHoldingDetail>
pub async fn broker_holding_detail( &self, symbol: impl Into<String>, ) -> Result<BrokerHoldingDetail>
Get full broker holding details for a security.
Path: GET /v1/quote/broker-holding/detail
Sourcepub async fn broker_holding_daily(
&self,
symbol: impl Into<String>,
broker_id: impl Into<String>,
) -> Result<BrokerHoldingDailyHistory>
pub async fn broker_holding_daily( &self, symbol: impl Into<String>, broker_id: impl Into<String>, ) -> Result<BrokerHoldingDailyHistory>
Get daily holding history for a specific broker.
Path: GET /v1/quote/broker-holding/daily
Get A/H premium K-line data for a dual-listed security.
Path: GET /v1/quote/ahpremium/klines
Get A/H premium intraday data for a dual-listed security.
Path: GET /v1/quote/ahpremium/timeshares
Sourcepub async fn trade_stats(
&self,
symbol: impl Into<String>,
) -> Result<TradeStatsResponse>
pub async fn trade_stats( &self, symbol: impl Into<String>, ) -> Result<TradeStatsResponse>
Get buy/sell/neutral trade statistics for a security.
Path: GET /v1/quote/trades-statistics
Sourcepub async fn anomaly(
&self,
market: impl Into<String>,
) -> Result<AnomalyResponse>
pub async fn anomaly( &self, market: impl Into<String>, ) -> Result<AnomalyResponse>
Get market anomaly alerts (unusual price/volume events).
Path: GET /v1/quote/changes
Sourcepub async fn constituent(
&self,
symbol: impl Into<String>,
) -> Result<IndexConstituents>
pub async fn constituent( &self, symbol: impl Into<String>, ) -> Result<IndexConstituents>
Get constituent stocks for an index.
symbol should be an index symbol such as "HSI.HK".
Path: GET /v1/quote/index-constituents
Trait Implementations§
Source§impl Clone for MarketContext
impl Clone for MarketContext
Source§fn clone(&self) -> MarketContext
fn clone(&self) -> MarketContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MarketContext
impl !RefUnwindSafe for MarketContext
impl Send for MarketContext
impl Sync for MarketContext
impl Unpin for MarketContext
impl UnsafeUnpin for MarketContext
impl !UnwindSafe for MarketContext
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
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