pub struct MockExecution<FnTime> {
pub mocked_exchange: ExchangeId,
pub clock: FnTime,
pub request_tx: UnboundedSender<MockExchangeRequest>,
pub event_rx: Receiver<UnindexedAccountEvent>,
}
Fields§
§mocked_exchange: ExchangeId
§clock: FnTime
§request_tx: UnboundedSender<MockExchangeRequest>
§event_rx: Receiver<UnindexedAccountEvent>
Implementations§
Source§impl<FnTime> MockExecution<FnTime>
impl<FnTime> MockExecution<FnTime>
pub const fn new( mocked_exchange: ExchangeId, clock: FnTime, request_tx: UnboundedSender<MockExchangeRequest>, event_rx: Receiver<UnindexedAccountEvent>, ) -> MockExecution<FnTime>
Source§impl<FnTime> MockExecution<FnTime>
impl<FnTime> MockExecution<FnTime>
pub fn time_request(&self) -> DateTime<Utc>
Trait Implementations§
Source§impl<FnTime> Clone for MockExecution<FnTime>where
FnTime: Clone,
impl<FnTime> Clone for MockExecution<FnTime>where
FnTime: Clone,
Source§impl<FnTime: Debug> Debug for MockExecution<FnTime>
impl<FnTime: Debug> Debug for MockExecution<FnTime>
Source§impl<FnTime> ExecutionClient for MockExecution<FnTime>
impl<FnTime> ExecutionClient for MockExecution<FnTime>
const EXCHANGE: ExchangeId = ExchangeId::Mock
type Config = MockExecutionClientConfig<FnTime>
type AccountStream = Pin<Box<dyn Stream<Item = AccountEvent<ExchangeId, AssetNameExchange, InstrumentNameExchange>> + Send>>
fn new(config: Self::Config) -> Self
async fn account_snapshot( &self, _: &[AssetNameExchange], _: &[InstrumentNameExchange], ) -> Result<UnindexedAccountSnapshot, UnindexedClientError>
async fn account_stream( &self, _: &[AssetNameExchange], _: &[InstrumentNameExchange], ) -> Result<Self::AccountStream, UnindexedClientError>
async fn cancel_order( &self, request: OrderRequestCancel<ExchangeId, &InstrumentNameExchange>, ) -> Option<UnindexedOrderResponseCancel>
async fn open_order( &self, request: OrderRequestOpen<ExchangeId, &InstrumentNameExchange>, ) -> Option<Order<ExchangeId, InstrumentNameExchange, Result<Open, UnindexedOrderError>>>
async fn fetch_balances( &self, ) -> Result<Vec<AssetBalance<AssetNameExchange>>, UnindexedClientError>
async fn fetch_open_orders( &self, ) -> Result<Vec<Order<ExchangeId, InstrumentNameExchange, Open>>, UnindexedClientError>
async fn fetch_trades( &self, time_since: DateTime<Utc>, ) -> Result<Vec<Trade<QuoteAsset, InstrumentNameExchange>>, UnindexedClientError>
fn cancel_orders<'a>( &self, requests: impl IntoIterator<Item = OrderRequestCancel<ExchangeId, &'a InstrumentNameExchange>>, ) -> impl Stream<Item = Option<UnindexedOrderResponseCancel>>
fn open_orders<'a>( &self, requests: impl IntoIterator<Item = OrderRequestOpen<ExchangeId, &'a InstrumentNameExchange>>, ) -> impl Stream<Item = Option<Order<ExchangeId, InstrumentNameExchange, Result<Open, UnindexedOrderError>>>>
Auto Trait Implementations§
impl<FnTime> Freeze for MockExecution<FnTime>where
FnTime: Freeze,
impl<FnTime> RefUnwindSafe for MockExecution<FnTime>where
FnTime: RefUnwindSafe,
impl<FnTime> Send for MockExecution<FnTime>where
FnTime: Send,
impl<FnTime> Sync for MockExecution<FnTime>where
FnTime: Sync,
impl<FnTime> Unpin for MockExecution<FnTime>where
FnTime: Unpin,
impl<FnTime> UnwindSafe for MockExecution<FnTime>where
FnTime: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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