pub enum Command {
PlaceOrder(PlaceOrder),
PlaceOrders(Vec<PlaceOrder>),
CancelOrder(CancelOrder),
CancelAll(CancelAll),
StopStrategy(StopStrategy),
}Expand description
Commands that strategies can emit.
Variants§
PlaceOrder(PlaceOrder)
Submit one limit order.
PlaceOrders(Vec<PlaceOrder>)
Submit several limit orders as one logical batch.
CancelOrder(CancelOrder)
Cancel one tracked order by client order ID.
CancelAll(CancelAll)
Cancel all tracked orders, optionally scoped to one instrument.
StopStrategy(StopStrategy)
Request strategy stop with a reason
Implementations§
Source§impl Command
impl Command
Sourcepub fn client_id(&self) -> Option<&ClientOrderId>
pub fn client_id(&self) -> Option<&ClientOrderId>
Get the client order ID if applicable (returns first one for batch)
Sourcepub fn instrument(&self) -> Option<&InstrumentId>
pub fn instrument(&self) -> Option<&InstrumentId>
Get the instrument if applicable (returns first one for batch)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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