pub enum OrderType {
Spot,
Market,
FillOrKill,
PostOnly,
Limit {
price: UnsignedDecimal,
timestamp: u64,
},
BoundedMarket {
max_price: UnsignedDecimal,
min_price: UnsignedDecimal,
},
}Expand description
High-level order type with associated data.
Used in create_order and Action::CreateOrder to provide compile-time
safety instead of raw &str matching. Limit and BoundedMarket variants
carry their required parameters.
Variants§
Implementations§
Source§impl OrderType
impl OrderType
Sourcepub fn to_encoding(
&self,
market: &Market,
) -> Result<(OrderTypeEncoding, Value), O2Error>
pub fn to_encoding( &self, market: &Market, ) -> Result<(OrderTypeEncoding, Value), O2Error>
Convert to the low-level OrderTypeEncoding and JSON representation
used by the encoding and API layers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrderType
impl RefUnwindSafe for OrderType
impl Send for OrderType
impl Sync for OrderType
impl Unpin for OrderType
impl UnwindSafe for OrderType
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