nautilus_data::client

Trait DataClient

source
pub trait DataClient {
Show 35 methods // Required methods fn client_id(&self) -> ClientId; fn venue(&self) -> Option<Venue>; fn start(&self); fn stop(&self); fn reset(&self); fn dispose(&self); fn is_connected(&self) -> bool; fn is_disconnected(&self) -> bool; fn subscribe(&mut self, data_type: &DataType) -> Result<()>; fn subscribe_instruments(&mut self, venue: Option<&Venue>) -> Result<()>; fn subscribe_instrument( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn subscribe_order_book_deltas( &mut self, instrument_id: &InstrumentId, book_type: BookType, depth: Option<usize>, ) -> Result<()>; fn subscribe_order_book_snapshots( &mut self, instrument_id: &InstrumentId, book_type: BookType, depth: Option<usize>, ) -> Result<()>; fn subscribe_quote_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn subscribe_trade_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn subscribe_bars(&mut self, bar_type: &BarType) -> Result<()>; fn subscribe_instrument_status( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn subscribe_instrument_close( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe(&mut self, data_type: &DataType) -> Result<()>; fn unsubscribe_instruments(&mut self, venue: Option<&Venue>) -> Result<()>; fn unsubscribe_instrument( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_order_book_deltas( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_order_book_snapshots( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_quote_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_trade_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_bars(&mut self, bar_type: &BarType) -> Result<()>; fn unsubscribe_instrument_status( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn unsubscribe_instrument_close( &mut self, instrument_id: &InstrumentId, ) -> Result<()>; fn request_data(&self, request: DataRequest); fn request_instruments( &self, correlation_id: UUID4, venue: Venue, start: Option<UnixNanos>, end: Option<UnixNanos>, ) -> Vec<InstrumentAny>; fn request_instrument( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, ) -> InstrumentAny; fn request_order_book_snapshot( &self, correlation_id: UUID4, instrument_id: InstrumentId, depth: Option<usize>, ) -> Payload; fn request_quote_ticks( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<QuoteTick>; fn request_trade_ticks( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<TradeTick>; fn request_bars( &self, correlation_id: UUID4, bar_type: BarType, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<Bar>;
}

Required Methods§

source

fn client_id(&self) -> ClientId

source

fn venue(&self) -> Option<Venue>

source

fn start(&self)

source

fn stop(&self)

source

fn reset(&self)

source

fn dispose(&self)

source

fn is_connected(&self) -> bool

source

fn is_disconnected(&self) -> bool

source

fn subscribe(&mut self, data_type: &DataType) -> Result<()>

Parse command and call specific function

source

fn subscribe_instruments(&mut self, venue: Option<&Venue>) -> Result<()>

source

fn subscribe_instrument(&mut self, instrument_id: &InstrumentId) -> Result<()>

source

fn subscribe_order_book_deltas( &mut self, instrument_id: &InstrumentId, book_type: BookType, depth: Option<usize>, ) -> Result<()>

source

fn subscribe_order_book_snapshots( &mut self, instrument_id: &InstrumentId, book_type: BookType, depth: Option<usize>, ) -> Result<()>

source

fn subscribe_quote_ticks(&mut self, instrument_id: &InstrumentId) -> Result<()>

source

fn subscribe_trade_ticks(&mut self, instrument_id: &InstrumentId) -> Result<()>

source

fn subscribe_bars(&mut self, bar_type: &BarType) -> Result<()>

source

fn subscribe_instrument_status( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn subscribe_instrument_close( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe(&mut self, data_type: &DataType) -> Result<()>

source

fn unsubscribe_instruments(&mut self, venue: Option<&Venue>) -> Result<()>

source

fn unsubscribe_instrument(&mut self, instrument_id: &InstrumentId) -> Result<()>

source

fn unsubscribe_order_book_deltas( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe_order_book_snapshots( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe_quote_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe_trade_ticks( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe_bars(&mut self, bar_type: &BarType) -> Result<()>

source

fn unsubscribe_instrument_status( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn unsubscribe_instrument_close( &mut self, instrument_id: &InstrumentId, ) -> Result<()>

source

fn request_data(&self, request: DataRequest)

source

fn request_instruments( &self, correlation_id: UUID4, venue: Venue, start: Option<UnixNanos>, end: Option<UnixNanos>, ) -> Vec<InstrumentAny>

source

fn request_instrument( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, ) -> InstrumentAny

source

fn request_order_book_snapshot( &self, correlation_id: UUID4, instrument_id: InstrumentId, depth: Option<usize>, ) -> Payload

source

fn request_quote_ticks( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<QuoteTick>

source

fn request_trade_ticks( &self, correlation_id: UUID4, instrument_id: InstrumentId, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<TradeTick>

source

fn request_bars( &self, correlation_id: UUID4, bar_type: BarType, start: Option<UnixNanos>, end: Option<UnixNanos>, limit: Option<usize>, ) -> Vec<Bar>

Implementors§