pub async fn place_and_cancel<U: OrderExecutor + ?Sized>(
ud: &U,
id: &InstrumentId,
price: Price,
)Expand description
Places a far-from-market limit order, reads its state by cid, cancels it.
Steps and checks:
placea buy limit order, one lot, atprice, with a fresh cid. The ack must carry the same cid and a non-empty broker order id.order_state(cid)must return a snapshot for that cid that is notRejected.cancel(cid)must succeed.
price must be far below the market so the order rests and does not fill, and must be a price the
mock accepts (not REJECT_PRICE). There is no retry: a local rate-limit refusal is a failure
here. The command gate must be open, so call reconcile first.
The mock must acknowledge a limit order, report its state, and cancel it.
§Panics
With [conformance:place_and_cancel] <reason> when place, order_state or cancel fails, or the
ack or snapshot is wrong. A NotReconciled error here means reconcile was not run first.
§Examples
brokapi_conformance::reconcile(&ud).await;
brokapi_conformance::place_and_cancel(&ud, &sber, Price::from(1)).await;