pub struct DataEngine { /* private fields */ }
Expand description
Provides a high-performance DataEngine
for all environments.
Implementations§
Source§impl DataEngine
impl DataEngine
Sourcepub fn new(
clock: Box<dyn Clock>,
cache: Rc<RefCell<Cache>>,
msgbus: Rc<RefCell<MessageBus>>,
config: Option<DataEngineConfig>,
) -> Self
pub fn new( clock: Box<dyn Clock>, cache: Rc<RefCell<Cache>>, msgbus: Rc<RefCell<MessageBus>>, config: Option<DataEngineConfig>, ) -> Self
Creates a new DataEngine
instance.
Sourcepub fn register_default_client(&mut self, client: DataClientAdapter)
pub fn register_default_client(&mut self, client: DataClientAdapter)
Registers the given data client
with the engine as the default routing client.
When a specific venue routing cannot be found, this client will receive messages.
§Warnings
Any existing default routing client will be overwritten. TODO: change this to suit message bus behaviour
pub fn start(self)
pub fn stop(self)
pub fn reset(self)
pub fn dispose(self)
pub fn connect(&self)
pub fn disconnect(&self)
pub fn check_connected(&self) -> bool
pub fn check_disconnected(&self) -> bool
pub fn registed_clients(&self) -> Vec<ClientId>
pub fn subscribed_custom_data(&self) -> Vec<DataType>
pub fn subscribed_instruments(&self) -> Vec<InstrumentId>
pub fn subscribed_order_book_deltas(&self) -> Vec<InstrumentId>
pub fn subscribed_order_book_snapshots(&self) -> Vec<InstrumentId>
pub fn subscribed_quote_ticks(&self) -> Vec<InstrumentId>
pub fn subscribed_trade_ticks(&self) -> Vec<InstrumentId>
pub fn subscribed_bars(&self) -> Vec<BarType>
pub fn subscribed_instrument_status(&self) -> Vec<InstrumentId>
pub fn subscribed_instrument_close(&self) -> Vec<InstrumentId>
pub fn on_start(self)
pub fn on_stop(self)
Sourcepub fn register_client(
&mut self,
client: DataClientAdapter,
routing: Option<Venue>,
)
pub fn register_client( &mut self, client: DataClientAdapter, routing: Option<Venue>, )
Registers a new DataClientAdapter
§Panics
This function panics:
- If a client with the same client ID has already been registered.
Sourcepub fn deregister_client(&mut self, client_id: &ClientId)
pub fn deregister_client(&mut self, client_id: &ClientId)
Deregisters a DataClientAdapter
§Panics
This function panics:
- If a client with the same client ID has not been registered.
pub fn run(&mut self)
pub fn enqueue(&mut self, cmd: &dyn Any)
pub fn execute(&mut self, cmd: SubscriptionCommand)
Sourcepub fn request(&self, req: DataRequest)
pub fn request(&self, req: DataRequest)
Sends a [DataRequest
] to an endpoint that must be a data client implementation.
pub fn process(&mut self, data: &dyn Any)
pub fn process_data(&mut self, data: Data)
pub fn response(&self, resp: DataResponse)
Auto Trait Implementations§
impl Freeze for DataEngine
impl !RefUnwindSafe for DataEngine
impl !Send for DataEngine
impl !Sync for DataEngine
impl Unpin for DataEngine
impl !UnwindSafe for DataEngine
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