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: Rc<RefCell<dyn Clock>>,
cache: Rc<RefCell<Cache>>,
config: Option<DataEngineConfig>,
) -> Self
pub fn new( clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, 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 registered_clients(&self) -> Vec<ClientId>
pub fn subscribed_custom_data(&self) -> Vec<DataType>
pub fn subscribed_instruments(&self) -> Vec<InstrumentId>
pub fn subscribed_book_deltas(&self) -> Vec<InstrumentId>
pub fn subscribed_book_snapshots(&self) -> Vec<InstrumentId>
pub fn subscribed_quotes(&self) -> Vec<InstrumentId>
pub fn subscribed_trades(&self) -> Vec<InstrumentId>
pub fn subscribed_bars(&self) -> Vec<BarType>
pub fn subscribed_mark_prices(&self) -> Vec<InstrumentId>
pub fn subscribed_index_prices(&self) -> Vec<InstrumentId>
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 execute(&mut self, cmd: DataCommand)
pub fn execute_subscribe(&mut self, cmd: SubscribeCommand) -> Result<()>
pub fn execute_unsubscribe(&mut self, cmd: UnsubscribeCommand) -> Result<()>
Sourcepub fn execute_request(&mut self, req: RequestCommand) -> Result<()>
pub fn execute_request(&mut self, req: RequestCommand) -> Result<()>
Sends a RequestCommand 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