pub struct MarketDataService { /* private fields */ }Implementations§
Source§impl MarketDataService
impl MarketDataService
pub fn new(ctx: ServiceContext) -> Self
Sourcepub async fn get_spot_config(&self) -> Result<SpotConfig>
pub async fn get_spot_config(&self) -> Result<SpotConfig>
Spot pair catalog (Go SpotConfig raw-map escape hatch).
Sourcepub async fn get_trades(
&self,
symbol: &str,
limit: Option<u32>,
) -> Result<MarketTradesResult>
pub async fn get_trades( &self, symbol: &str, limit: Option<u32>, ) -> Result<MarketTradesResult>
Recent public trades for a symbol (resolves symbol_id via catalogs after hydrate).
pub async fn get_trades_with( &self, opts: GetTradesOpts, ) -> Result<MarketTradesResult>
Sourcepub async fn get_candles(
&self,
symbol: &str,
interval: &str,
limit: Option<u32>,
) -> Result<CandlesResult>
pub async fn get_candles( &self, symbol: &str, interval: &str, limit: Option<u32>, ) -> Result<CandlesResult>
Candle series for a symbol, ordered newest-first by ts_sec.
interval accepts values like "1m", "MIN_1", "5m". When
incomplete candles are requested, the current open candle is prepended.
pub async fn get_candles_with( &self, opts: GetCandlesOpts, ) -> Result<CandlesResult>
Sourcepub async fn get_current_candle(
&self,
symbol: &str,
timeframe: &str,
) -> Result<Option<Candle>>
pub async fn get_current_candle( &self, symbol: &str, timeframe: &str, ) -> Result<Option<Candle>>
Latest candle for a symbol/timeframe, or None when the market has no rows.
Sourcepub async fn get_candles_columns(
&self,
opts: GetCandlesOpts,
) -> Result<CandlesResult>
pub async fn get_candles_columns( &self, opts: GetCandlesOpts, ) -> Result<CandlesResult>
Columnar OHLCV candles decoded into row-oriented CandlesResult.
Sourcepub async fn subscribe_trades(
&self,
symbol: &str,
) -> Result<TypedSubscription<MarketTrade>>
pub async fn subscribe_trades( &self, symbol: &str, ) -> Result<TypedSubscription<MarketTrade>>
Subscribe to public spot trades for a symbol (requires realtime feature + hydrated catalogs).
Sourcepub async fn subscribe_candles(
&self,
symbol: &str,
timeframe: &str,
) -> Result<TypedSubscription<Candle>>
pub async fn subscribe_candles( &self, symbol: &str, timeframe: &str, ) -> Result<TypedSubscription<Candle>>
Subscribe to public candle updates (requires realtime feature + hydrated catalogs).
Trait Implementations§
Source§impl Clone for MarketDataService
impl Clone for MarketDataService
Source§fn clone(&self) -> MarketDataService
fn clone(&self) -> MarketDataService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for MarketDataService
impl !RefUnwindSafe for MarketDataService
impl !UnwindSafe for MarketDataService
impl Send for MarketDataService
impl Sync for MarketDataService
impl Unpin for MarketDataService
impl UnsafeUnpin for MarketDataService
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
Mutably borrows from an owned value. Read more