pub struct PlaceOrderRequest<'a> { /* 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<'a> PlaceOrderRequest<'a>
impl<'a> PlaceOrderRequest<'a>
Sourcepub fn new(
inst_id: impl Into<Cow<'a, str>>,
td_mode: TradeMode,
side: OrderSide,
ord_type: OrderType,
sz: impl Into<Cow<'a, str>>,
) -> Self
pub fn new( inst_id: impl Into<Cow<'a, str>>, td_mode: TradeMode, side: OrderSide, ord_type: OrderType, sz: impl Into<Cow<'a, str>>, ) -> Self
Create a new order request with the required fields.
Sourcepub fn price(self, px: impl Into<Cow<'a, str>>) -> Self
pub fn price(self, px: impl Into<Cow<'a, str>>) -> 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<Cow<'a, str>>) -> Self
pub fn client_order_id(self, cl_ord_id: impl Into<Cow<'a, str>>) -> 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<Cow<'a, str>>) -> Self
pub fn target_ccy(self, tgt_ccy: impl Into<Cow<'a, str>>) -> Self
Set the quantity unit for spot market orders (base_ccy/quote_ccy).
Trait Implementations§
Source§impl<'a> Clone for PlaceOrderRequest<'a>
impl<'a> Clone for PlaceOrderRequest<'a>
Source§fn clone(&self) -> PlaceOrderRequest<'a>
fn clone(&self) -> PlaceOrderRequest<'a>
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<'a> Debug for PlaceOrderRequest<'a>
impl<'a> Debug for PlaceOrderRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for PlaceOrderRequest<'a>
impl<'a> RefUnwindSafe for PlaceOrderRequest<'a>
impl<'a> Send for PlaceOrderRequest<'a>
impl<'a> Sync for PlaceOrderRequest<'a>
impl<'a> Unpin for PlaceOrderRequest<'a>
impl<'a> UnsafeUnpin for PlaceOrderRequest<'a>
impl<'a> UnwindSafe for PlaceOrderRequest<'a>
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