pub struct StubExecutionClient { /* private fields */ }Expand description
A stub execution client for testing purposes.
This client provides a minimal implementation of the ExecutionClient trait
that can be used in unit tests without requiring actual venue connectivity.
Implementations§
Source§impl StubExecutionClient
impl StubExecutionClient
Sourcepub fn new(
client_id: ClientId,
account_id: AccountId,
venue: Venue,
oms_type: OmsType,
clock: Option<Rc<RefCell<dyn Clock>>>,
) -> Self
pub fn new( client_id: ClientId, account_id: AccountId, venue: Venue, oms_type: OmsType, clock: Option<Rc<RefCell<dyn Clock>>>, ) -> Self
Creates a new StubExecutionClient instance.
Sourcepub fn with_handles_all_order_venues(self) -> Self
pub fn with_handles_all_order_venues(self) -> Self
Configures this stub to accept orders for any instrument venue.
Sourcepub fn with_submit_order_error(self, error: impl Into<String>) -> Self
pub fn with_submit_order_error(self, error: impl Into<String>) -> Self
Configures this stub to fail single-order submissions.
Sourcepub fn with_submit_order_list_error(self, error: impl Into<String>) -> Self
pub fn with_submit_order_list_error(self, error: impl Into<String>) -> Self
Configures this stub to fail order-list submissions.
Sourcepub fn received_instruments(&self) -> Rc<RefCell<Vec<InstrumentAny>>>
pub fn received_instruments(&self) -> Rc<RefCell<Vec<InstrumentAny>>>
Returns a shared handle to the instruments delivered via [ExecutionClient::on_instrument].
Sourcepub fn submitted_order_ids(&self) -> Rc<RefCell<Vec<ClientOrderId>>>
pub fn submitted_order_ids(&self) -> Rc<RefCell<Vec<ClientOrderId>>>
Returns a shared handle to the submitted order IDs.
Sourcepub fn modified_order_ids(&self) -> Rc<RefCell<Vec<ClientOrderId>>>
pub fn modified_order_ids(&self) -> Rc<RefCell<Vec<ClientOrderId>>>
Returns a shared handle to the modified order IDs.
Sourcepub fn queried_account_ids(&self) -> Rc<RefCell<Vec<AccountId>>>
pub fn queried_account_ids(&self) -> Rc<RefCell<Vec<AccountId>>>
Returns a shared handle to the queried account IDs.
Sourcepub fn start_count(&self) -> usize
pub fn start_count(&self) -> usize
Returns the number of times [ExecutionClient::start] was invoked.
Sourcepub fn stop_count(&self) -> usize
pub fn stop_count(&self) -> usize
Returns the number of times [ExecutionClient::stop] was invoked.
Sourcepub fn reset_count(&self) -> usize
pub fn reset_count(&self) -> usize
Returns the number of times [ExecutionClient::reset] was invoked.
Sourcepub fn dispose_count(&self) -> usize
pub fn dispose_count(&self) -> usize
Returns the number of times [ExecutionClient::dispose] was invoked.
Trait Implementations§
Source§impl Clone for StubExecutionClient
impl Clone for StubExecutionClient
Source§fn clone(&self) -> StubExecutionClient
fn clone(&self) -> StubExecutionClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more