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§
Trait Implementations§
Source§impl Clone for StubExecutionClient
impl Clone for StubExecutionClient
Source§fn clone(&self) -> StubExecutionClient
fn clone(&self) -> StubExecutionClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StubExecutionClient
impl Debug for StubExecutionClient
Source§impl ExecutionClient for StubExecutionClient
impl ExecutionClient for StubExecutionClient
fn is_connected(&self) -> bool
fn client_id(&self) -> ClientId
fn account_id(&self) -> AccountId
fn venue(&self) -> Venue
fn oms_type(&self) -> OmsType
fn get_account(&self) -> Option<AccountAny>
Source§fn generate_account_state(
&self,
_balances: Vec<AccountBalance>,
_margins: Vec<MarginBalance>,
_reported: bool,
_ts_event: UnixNanos,
) -> Result<()>
fn generate_account_state( &self, _balances: Vec<AccountBalance>, _margins: Vec<MarginBalance>, _reported: bool, _ts_event: UnixNanos, ) -> Result<()>
Generates and publishes the account state event. Read more
Source§fn submit_order(&self, _cmd: &SubmitOrder) -> Result<()>
fn submit_order(&self, _cmd: &SubmitOrder) -> Result<()>
Submits a single order command to the execution venue. Read more
Source§fn submit_order_list(&self, _cmd: &SubmitOrderList) -> Result<()>
fn submit_order_list(&self, _cmd: &SubmitOrderList) -> Result<()>
Submits a list of orders to the execution venue. Read more
Source§fn modify_order(&self, _cmd: &ModifyOrder) -> Result<()>
fn modify_order(&self, _cmd: &ModifyOrder) -> Result<()>
Modifies an existing order. Read more
Source§fn cancel_all_orders(&self, _cmd: &CancelAllOrders) -> Result<()>
fn cancel_all_orders(&self, _cmd: &CancelAllOrders) -> Result<()>
Cancels all orders. Read more
Source§fn batch_cancel_orders(&self, _cmd: &BatchCancelOrders) -> Result<()>
fn batch_cancel_orders(&self, _cmd: &BatchCancelOrders) -> Result<()>
Cancels a batch of orders. Read more
Source§fn query_account(&self, _cmd: &QueryAccount) -> Result<()>
fn query_account(&self, _cmd: &QueryAccount) -> Result<()>
Queries the status of an account. Read more
Source§fn query_order(&self, _cmd: &QueryOrder) -> Result<()>
fn query_order(&self, _cmd: &QueryOrder) -> Result<()>
Queries the status of an order. Read more
§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Connects the client to the execution venue. Read more
§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Disconnects the client from the execution venue. Read more
§fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generates a single order status report. Read more
§fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generates multiple order status reports. Read more
§fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Generates fill reports based on execution results. Read more
§fn generate_position_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GeneratePositionStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<PositionStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn generate_position_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GeneratePositionStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<PositionStatusReport>, Error>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generates position status reports. Read more
Auto Trait Implementations§
impl Freeze for StubExecutionClient
impl !RefUnwindSafe for StubExecutionClient
impl !Send for StubExecutionClient
impl !Sync for StubExecutionClient
impl Unpin for StubExecutionClient
impl !UnwindSafe for StubExecutionClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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