Skip to main content

SendRequests

Trait SendRequests 

Source
pub trait SendRequests<ExchangeKey = ExchangeIndex, InstrumentKey = InstrumentIndex> {
    // Required methods
    fn send_requests<Kind>(
        &self,
        requests: impl IntoIterator<Item = OrderEvent<Kind, ExchangeKey, InstrumentKey>>,
    ) -> SendRequestsOutput<Kind, ExchangeKey, InstrumentKey>
       where Kind: Debug + Clone,
             ExecutionRequest<ExchangeKey, InstrumentKey>: From<OrderEvent<Kind, ExchangeKey, InstrumentKey>>;
    fn send_request<Kind>(
        &self,
        request: &OrderEvent<Kind, ExchangeKey, InstrumentKey>,
    ) -> Result<(), EngineError>
       where Kind: Debug + Clone,
             ExecutionRequest<ExchangeKey, InstrumentKey>: From<OrderEvent<Kind, ExchangeKey, InstrumentKey>>;
}
Expand description

Trait that defines how the Engine sends order requests.

§Type Parameters

  • ExchangeKey - Type used to identify an exchange (defaults to ExchangeIndex).
  • InstrumentKey - Type used to identify an instrument (defaults to InstrumentIndex).

Required Methods§

Source

fn send_requests<Kind>( &self, requests: impl IntoIterator<Item = OrderEvent<Kind, ExchangeKey, InstrumentKey>>, ) -> SendRequestsOutput<Kind, ExchangeKey, InstrumentKey>
where Kind: Debug + Clone, ExecutionRequest<ExchangeKey, InstrumentKey>: From<OrderEvent<Kind, ExchangeKey, InstrumentKey>>,

Source

fn send_request<Kind>( &self, request: &OrderEvent<Kind, ExchangeKey, InstrumentKey>, ) -> Result<(), EngineError>
where Kind: Debug + Clone, ExecutionRequest<ExchangeKey, InstrumentKey>: From<OrderEvent<Kind, ExchangeKey, InstrumentKey>>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Clock, State, ExecutionTxs, Strategy, Risk, ExchangeKey, InstrumentKey> SendRequests<ExchangeKey, InstrumentKey> for Engine<Clock, State, ExecutionTxs, Strategy, Risk>
where ExecutionTxs: ExecutionTxMap<ExchangeKey, InstrumentKey>, ExchangeKey: Debug + Clone, InstrumentKey: Debug + Clone,