pub struct BybitDataClient { /* private fields */ }Expand description
Live market data client for Bybit.
Implementations§
Source§impl BybitDataClient
impl BybitDataClient
Sourcepub fn new(client_id: ClientId, config: BybitDataClientConfig) -> Result<Self>
pub fn new(client_id: ClientId, config: BybitDataClientConfig) -> Result<Self>
Creates a new BybitDataClient instance.
Omitted credentials resolve from the environment variables selected by
config.environment. An explicit value takes precedence over the matching
variable. A missing key or secret leaves the client without credentials.
Public market-data requests stay unsigned.
§Errors
Returns an error if the client fails to initialize.
Trait Implementations§
Source§impl DataClient for BybitDataClient
impl DataClient for BybitDataClient
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects the client to the data provider. Read more
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects the client from the data provider. Read more
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns
true if the client is currently connected.Source§fn is_disconnected(&self) -> bool
fn is_disconnected(&self) -> bool
Returns
true if the client is currently disconnected.Source§fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<()>
fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<()>
Subscribes to custom data types according to the command. Read more
Source§fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
Subscribes to order book delta updates for the specified instruments. Read more
Source§fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
Subscribes to quote updates for the specified instruments. Read more
Source§fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
Subscribes to trade updates for the specified instruments. Read more
Source§fn subscribe_funding_rates(&mut self, cmd: SubscribeFundingRates) -> Result<()>
fn subscribe_funding_rates(&mut self, cmd: SubscribeFundingRates) -> Result<()>
Subscribes to funding rate updates for the specified instruments. Read more
Source§fn subscribe_mark_prices(&mut self, cmd: SubscribeMarkPrices) -> Result<()>
fn subscribe_mark_prices(&mut self, cmd: SubscribeMarkPrices) -> Result<()>
Subscribes to mark price updates for the specified instruments. Read more
Source§fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> Result<()>
fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> Result<()>
Subscribes to index price updates for the specified instruments. Read more
Source§fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
Subscribes to bar updates of the specified full bar types. Read more
Source§fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<()>
fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<()>
Unsubscribes from custom data types according to the command. Read more
Source§fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
Unsubscribes from order book delta updates for the specified instruments. Read more
Source§fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
Unsubscribes from quote updates for the specified instruments. Read more
Source§fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
Unsubscribes from trade updates for the specified instruments. Read more
Source§fn unsubscribe_funding_rates(
&mut self,
cmd: &UnsubscribeFundingRates,
) -> Result<()>
fn unsubscribe_funding_rates( &mut self, cmd: &UnsubscribeFundingRates, ) -> Result<()>
Unsubscribes from funding rate updates for the specified instruments. Read more
Source§fn unsubscribe_mark_prices(&mut self, cmd: &UnsubscribeMarkPrices) -> Result<()>
fn unsubscribe_mark_prices(&mut self, cmd: &UnsubscribeMarkPrices) -> Result<()>
Unsubscribes from mark price updates for the specified instruments. Read more
Source§fn unsubscribe_index_prices(
&mut self,
cmd: &UnsubscribeIndexPrices,
) -> Result<()>
fn unsubscribe_index_prices( &mut self, cmd: &UnsubscribeIndexPrices, ) -> Result<()>
Unsubscribes from index price updates for the specified instruments. Read more
Source§fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
Unsubscribes from bar updates of the specified full bar types. Read more
Source§fn subscribe_option_greeks(&mut self, cmd: SubscribeOptionGreeks) -> Result<()>
fn subscribe_option_greeks(&mut self, cmd: SubscribeOptionGreeks) -> Result<()>
Subscribes to exchange-provided option greeks for the specified instruments. Read more
Source§fn unsubscribe_option_greeks(
&mut self,
cmd: &UnsubscribeOptionGreeks,
) -> Result<()>
fn unsubscribe_option_greeks( &mut self, cmd: &UnsubscribeOptionGreeks, ) -> Result<()>
Unsubscribes from exchange-provided option greeks for the specified instruments. Read more
Source§fn subscribe_instruments(&mut self, cmd: SubscribeInstruments) -> Result<()>
fn subscribe_instruments(&mut self, cmd: SubscribeInstruments) -> Result<()>
Subscribes to instruments list for the specified venue. Read more
Source§fn subscribe_instrument(&mut self, cmd: SubscribeInstrument) -> Result<()>
fn subscribe_instrument(&mut self, cmd: SubscribeInstrument) -> Result<()>
Subscribes to definitions for the specified instruments. Read more
Source§fn unsubscribe_instruments(
&mut self,
cmd: &UnsubscribeInstruments,
) -> Result<()>
fn unsubscribe_instruments( &mut self, cmd: &UnsubscribeInstruments, ) -> Result<()>
Unsubscribes from instruments list for the specified venue. Read more
Source§fn unsubscribe_instrument(&mut self, cmd: &UnsubscribeInstrument) -> Result<()>
fn unsubscribe_instrument(&mut self, cmd: &UnsubscribeInstrument) -> Result<()>
Unsubscribes from data for the specified instruments. Read more
Source§fn subscribe_instrument_status(
&mut self,
cmd: SubscribeInstrumentStatus,
) -> Result<()>
fn subscribe_instrument_status( &mut self, cmd: SubscribeInstrumentStatus, ) -> Result<()>
Subscribes to status updates for the specified instruments. Read more
Source§fn unsubscribe_instrument_status(
&mut self,
cmd: &UnsubscribeInstrumentStatus,
) -> Result<()>
fn unsubscribe_instrument_status( &mut self, cmd: &UnsubscribeInstrumentStatus, ) -> Result<()>
Unsubscribes from instrument status updates for the specified instruments. Read more
Source§fn request_instruments(&self, request: RequestInstruments) -> Result<()>
fn request_instruments(&self, request: RequestInstruments) -> Result<()>
Requests a list of instruments from the provider for a given venue. Read more
Source§fn request_instrument(&self, request: RequestInstrument) -> Result<()>
fn request_instrument(&self, request: RequestInstrument) -> Result<()>
Requests detailed data for a single instrument. Read more
Source§fn request_book_snapshot(&self, request: RequestBookSnapshot) -> Result<()>
fn request_book_snapshot(&self, request: RequestBookSnapshot) -> Result<()>
Requests a snapshot of the order book for a specified instrument. Read more
Source§fn request_trades(&self, request: RequestTrades) -> Result<()>
fn request_trades(&self, request: RequestTrades) -> Result<()>
Requests historical or streaming trade data for a specified instrument. Read more
Source§fn request_bars(&self, request: RequestBars) -> Result<()>
fn request_bars(&self, request: RequestBars) -> Result<()>
Requests historical or streaming bar data for a specified instrument and bar type. Read more
Source§fn request_funding_rates(&self, request: RequestFundingRates) -> Result<()>
fn request_funding_rates(&self, request: RequestFundingRates) -> Result<()>
Requests historical or streaming funding rate data for a specified instrument. Read more
Source§fn request_option_chain_reference_price(
&self,
request: RequestOptionChainReferencePrice,
) -> Result<()>
fn request_option_chain_reference_price( &self, request: RequestOptionChainReferencePrice, ) -> Result<()>
Requests a reference price for an option-chain bootstrap. Read more
Source§fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<(), Error>
fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<(), Error>
Subscribes to order book depth snapshot updates for the specified instruments. Read more
Source§fn subscribe_instrument_close(
&mut self,
cmd: SubscribeInstrumentClose,
) -> Result<(), Error>
fn subscribe_instrument_close( &mut self, cmd: SubscribeInstrumentClose, ) -> Result<(), Error>
Subscribes to instrument close events for the specified instruments. Read more
Source§fn unsubscribe_book_depth(
&mut self,
cmd: &UnsubscribeBookDepth,
) -> Result<(), Error>
fn unsubscribe_book_depth( &mut self, cmd: &UnsubscribeBookDepth, ) -> Result<(), Error>
Unsubscribes from order book depth snapshot updates for the specified instruments. Read more
Source§fn unsubscribe_instrument_close(
&mut self,
cmd: &UnsubscribeInstrumentClose,
) -> Result<(), Error>
fn unsubscribe_instrument_close( &mut self, cmd: &UnsubscribeInstrumentClose, ) -> Result<(), Error>
Unsubscribes from instrument close events for the specified instruments. Read more
Source§fn request_data(&self, _request: RequestCustomData) -> Result<(), Error>
fn request_data(&self, _request: RequestCustomData) -> Result<(), Error>
Sends a custom data request to the provider. Read more
Source§fn request_quotes(&self, _request: RequestQuotes) -> Result<(), Error>
fn request_quotes(&self, _request: RequestQuotes) -> Result<(), Error>
Requests historical or streaming quote data for a specified instrument. Read more
Source§fn request_book_depth(&self, _request: RequestBookDepth) -> Result<(), Error>
fn request_book_depth(&self, _request: RequestBookDepth) -> Result<(), Error>
Requests historical order book depth data for a specified instrument. Read more
Source§fn request_book_deltas(&self, _request: RequestBookDeltas) -> Result<(), Error>
fn request_book_deltas(&self, _request: RequestBookDeltas) -> Result<(), Error>
Requests historical order book delta data for a specified instrument. Read more
Auto Trait Implementations§
impl !Freeze for BybitDataClient
impl !RefUnwindSafe for BybitDataClient
impl !UnwindSafe for BybitDataClient
impl Forget for BybitDataClient
impl Send for BybitDataClient
impl Sync for BybitDataClient
impl Unpin for BybitDataClient
impl UnsafeUnpin for BybitDataClient
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