pub struct ClosePositionRequest { /* private fields */ }Expand description
A request to close positions.
Implementations§
Source§impl ClosePositionRequest
impl ClosePositionRequest
Sourcepub fn new(inst_id: impl Into<String>, mgn_mode: TradeMode) -> Self
pub fn new(inst_id: impl Into<String>, mgn_mode: TradeMode) -> Self
Create a close-position request.
Sourcepub fn position_side(self, pos_side: PositionSide) -> Self
pub fn position_side(self, pos_side: PositionSide) -> Self
Set the position side.
Sourcepub fn auto_cancel(self, auto_cancel: bool) -> Self
pub fn auto_cancel(self, auto_cancel: bool) -> Self
Set whether pending orders should be canceled automatically.
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 the client order ID.
Trait Implementations§
Source§impl Clone for ClosePositionRequest
impl Clone for ClosePositionRequest
Source§fn clone(&self) -> ClosePositionRequest
fn clone(&self) -> ClosePositionRequest
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 ClosePositionRequest
impl Debug for ClosePositionRequest
Auto Trait Implementations§
impl Freeze for ClosePositionRequest
impl RefUnwindSafe for ClosePositionRequest
impl Send for ClosePositionRequest
impl Sync for ClosePositionRequest
impl Unpin for ClosePositionRequest
impl UnsafeUnpin for ClosePositionRequest
impl UnwindSafe for ClosePositionRequest
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