pub struct PlaceOrderRequest { /* private fields */ }Expand description
A request to place an order.
Construct with PlaceOrderRequest::new (required fields) and chain setters
for optional fields. Optional fields are omitted from the request body when
unset.
Implementations§
Source§impl PlaceOrderRequest
impl PlaceOrderRequest
Sourcepub fn new(
inst_id: impl Into<String>,
td_mode: TradeMode,
side: OrderSide,
ord_type: OrderType,
sz: impl Into<String>,
) -> Self
pub fn new( inst_id: impl Into<String>, td_mode: TradeMode, side: OrderSide, ord_type: OrderType, sz: impl Into<String>, ) -> Self
Create a new order request with the required fields.
Sourcepub fn price(self, px: impl Into<String>) -> Self
pub fn price(self, px: impl Into<String>) -> Self
Set the order price (required for limit-style orders).
Sourcepub fn position_side(self, pos_side: PositionSide) -> Self
pub fn position_side(self, pos_side: PositionSide) -> Self
Set the position side (long/short/net).
Sourcepub fn client_order_id(self, cl_ord_id: impl Into<String>) -> Self
pub fn client_order_id(self, cl_ord_id: impl Into<String>) -> Self
Set a client-supplied order ID.
Sourcepub fn reduce_only(self, reduce_only: bool) -> Self
pub fn reduce_only(self, reduce_only: bool) -> Self
Mark the order as reduce-only.
Sourcepub fn target_ccy(self, tgt_ccy: impl Into<String>) -> Self
pub fn target_ccy(self, tgt_ccy: impl Into<String>) -> Self
Set the quantity unit for spot market orders (base_ccy/quote_ccy).
Trait Implementations§
Source§impl Clone for PlaceOrderRequest
impl Clone for PlaceOrderRequest
Source§fn clone(&self) -> PlaceOrderRequest
fn clone(&self) -> PlaceOrderRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlaceOrderRequest
impl Debug for PlaceOrderRequest
Auto Trait Implementations§
impl Freeze for PlaceOrderRequest
impl RefUnwindSafe for PlaceOrderRequest
impl Send for PlaceOrderRequest
impl Sync for PlaceOrderRequest
impl Unpin for PlaceOrderRequest
impl UnsafeUnpin for PlaceOrderRequest
impl UnwindSafe for PlaceOrderRequest
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