pub struct ClosePositionRequest<'a> { /* private fields */ }Expand description
A request to close positions.
Implementations§
Source§impl<'a> ClosePositionRequest<'a>
impl<'a> ClosePositionRequest<'a>
Sourcepub fn new(inst_id: impl Into<Cow<'a, str>>, mgn_mode: TradeMode) -> Self
pub fn new(inst_id: impl Into<Cow<'a, str>>, 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<Cow<'a, str>>) -> Self
pub fn client_order_id(self, cl_ord_id: impl Into<Cow<'a, str>>) -> Self
Set the client order ID.
Trait Implementations§
Source§impl<'a> Clone for ClosePositionRequest<'a>
impl<'a> Clone for ClosePositionRequest<'a>
Source§fn clone(&self) -> ClosePositionRequest<'a>
fn clone(&self) -> ClosePositionRequest<'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 ClosePositionRequest<'a>
impl<'a> Debug for ClosePositionRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for ClosePositionRequest<'a>
impl<'a> RefUnwindSafe for ClosePositionRequest<'a>
impl<'a> Send for ClosePositionRequest<'a>
impl<'a> Sync for ClosePositionRequest<'a>
impl<'a> Unpin for ClosePositionRequest<'a>
impl<'a> UnsafeUnpin for ClosePositionRequest<'a>
impl<'a> UnwindSafe for ClosePositionRequest<'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