pub struct DataClientAdapter {Show 14 fields
pub client_id: ClientId,
pub venue: Venue,
pub handles_order_book_deltas: bool,
pub handles_order_book_snapshots: bool,
pub subscriptions_generic: HashSet<DataType>,
pub subscriptions_order_book_delta: HashSet<InstrumentId>,
pub subscriptions_order_book_snapshot: HashSet<InstrumentId>,
pub subscriptions_quote_tick: HashSet<InstrumentId>,
pub subscriptions_trade_tick: HashSet<InstrumentId>,
pub subscriptions_bar: HashSet<BarType>,
pub subscriptions_instrument_status: HashSet<InstrumentId>,
pub subscriptions_instrument_close: HashSet<InstrumentId>,
pub subscriptions_instrument: HashSet<InstrumentId>,
pub subscriptions_instrument_venue: HashSet<Venue>,
/* private fields */
}
Fields§
§client_id: ClientId
§venue: Venue
§handles_order_book_deltas: bool
§handles_order_book_snapshots: bool
§subscriptions_generic: HashSet<DataType>
§subscriptions_order_book_delta: HashSet<InstrumentId>
§subscriptions_order_book_snapshot: HashSet<InstrumentId>
§subscriptions_quote_tick: HashSet<InstrumentId>
§subscriptions_trade_tick: HashSet<InstrumentId>
§subscriptions_bar: HashSet<BarType>
§subscriptions_instrument_status: HashSet<InstrumentId>
§subscriptions_instrument_close: HashSet<InstrumentId>
§subscriptions_instrument: HashSet<InstrumentId>
§subscriptions_instrument_venue: HashSet<Venue>
Implementations§
Source§impl DataClientAdapter
impl DataClientAdapter
Sourcepub fn new(
client_id: ClientId,
venue: Venue,
handles_order_book_deltas: bool,
handles_order_book_snapshots: bool,
client: Box<dyn DataClient>,
clock: Box<dyn Clock>,
) -> Self
pub fn new( client_id: ClientId, venue: Venue, handles_order_book_deltas: bool, handles_order_book_snapshots: bool, client: Box<dyn DataClient>, clock: Box<dyn Clock>, ) -> Self
Creates a new DataClientAdapter
instance.
Sourcepub fn through_execute(&self, command: SubscriptionCommand)
pub fn through_execute(&self, command: SubscriptionCommand)
TODO: Decide whether to use mut references for subscription commands
pub fn execute(&mut self, command: SubscriptionCommand)
pub fn subscribe(&mut self, command: SubscriptionCommand)
pub fn unsubscribe(&mut self, command: SubscriptionCommand)
Sourcepub fn through_request(&self, req: DataRequest)
pub fn through_request(&self, req: DataRequest)
TODO: New clients implement a request pattern
that does not return a DataResponse
directly
it internally uses a queue/channel to send
back response
pub fn request(&self, req: DataRequest) -> DataResponse
pub fn handle_instrument( &self, instrument: InstrumentAny, correlation_id: UUID4, ) -> DataResponse
pub fn handle_instruments( &self, venue: Venue, instruments: Vec<InstrumentAny>, correlation_id: UUID4, ) -> DataResponse
pub fn handle_quote_ticks( &self, instrument_id: &InstrumentId, quotes: Vec<QuoteTick>, correlation_id: UUID4, ) -> DataResponse
pub fn handle_trade_ticks( &self, instrument_id: &InstrumentId, trades: Vec<TradeTick>, correlation_id: UUID4, ) -> DataResponse
pub fn handle_bars( &self, bar_type: &BarType, bars: Vec<Bar>, correlation_id: UUID4, ) -> DataResponse
Trait Implementations§
Source§impl Deref for DataClientAdapter
impl Deref for DataClientAdapter
Auto Trait Implementations§
impl Freeze for DataClientAdapter
impl !RefUnwindSafe for DataClientAdapter
impl !Send for DataClientAdapter
impl !Sync for DataClientAdapter
impl Unpin for DataClientAdapter
impl !UnwindSafe for DataClientAdapter
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
§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>
Converts
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>
Converts
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