pub struct CancelAll {
pub exchange: ExchangeInstance,
pub instrument: Option<InstrumentId>,
}Expand description
Cancel all orders (optionally for a specific instrument)
Fields§
§exchange: ExchangeInstanceTarget exchange instance
instrument: Option<InstrumentId>Optionally limit to a specific instrument
Implementations§
Source§impl CancelAll
impl CancelAll
Sourcepub fn new(exchange: ExchangeInstance) -> Self
pub fn new(exchange: ExchangeInstance) -> Self
Create a command that cancels every open order on an exchange instance.
Use CancelAll::for_instrument when the cancellation should be
limited to one instrument.
Sourcepub fn for_instrument(
exchange: ExchangeInstance,
instrument: InstrumentId,
) -> Self
pub fn for_instrument( exchange: ExchangeInstance, instrument: InstrumentId, ) -> Self
Create a command that cancels all open orders for one instrument.
§Example
use bot_core::{CancelAll, Environment, ExchangeId, ExchangeInstance, InstrumentId};
let exchange = ExchangeInstance::new(ExchangeId::new("hyperliquid"), Environment::Testnet);
let cancel = CancelAll::for_instrument(exchange, InstrumentId::new("ETH-PERP"));
assert_eq!(cancel.instrument.unwrap().as_str(), "ETH-PERP");Trait Implementations§
Source§impl<'de> Deserialize<'de> for CancelAll
impl<'de> Deserialize<'de> for CancelAll
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 CancelAll
impl RefUnwindSafe for CancelAll
impl Send for CancelAll
impl Sync for CancelAll
impl Unpin for CancelAll
impl UnsafeUnpin for CancelAll
impl UnwindSafe for CancelAll
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