pub struct OrderBuilder { /* private fields */ }Implementations§
Source§impl OrderBuilder
impl OrderBuilder
pub fn new() -> Self
pub fn grouping(self, g: Grouping) -> Self
Sourcepub fn push_limit(
self,
asset: u32,
is_buy: bool,
px: &(impl ToString + ?Sized),
sz: &(impl ToString + ?Sized),
reduce_only: bool,
tif: TimeInForceRequest,
cloid: Option<String>,
) -> Self
pub fn push_limit( self, asset: u32, is_buy: bool, px: &(impl ToString + ?Sized), sz: &(impl ToString + ?Sized), reduce_only: bool, tif: TimeInForceRequest, cloid: Option<String>, ) -> Self
Create a limit order with individual parameters (legacy method)
Sourcepub fn push_limit_order(self, params: LimitOrderParams) -> Self
pub fn push_limit_order(self, params: LimitOrderParams) -> Self
Create a limit order using parameters struct
Sourcepub fn push_trigger(
self,
asset: u32,
is_buy: bool,
px: &(impl ToString + ?Sized),
sz: &(impl ToString + ?Sized),
reduce_only: bool,
is_market: bool,
trigger_px: &(impl ToString + ?Sized),
tpsl: TpSlRequest,
cloid: Option<String>,
) -> Self
pub fn push_trigger( self, asset: u32, is_buy: bool, px: &(impl ToString + ?Sized), sz: &(impl ToString + ?Sized), reduce_only: bool, is_market: bool, trigger_px: &(impl ToString + ?Sized), tpsl: TpSlRequest, cloid: Option<String>, ) -> Self
Create a trigger order with individual parameters (legacy method)
Sourcepub fn push_trigger_order(self, params: TriggerOrderParams) -> Self
pub fn push_trigger_order(self, params: TriggerOrderParams) -> Self
Create a trigger order using parameters struct
pub fn build(self) -> ActionRequest
Sourcepub fn single_limit_order(params: LimitOrderParams) -> ActionRequest
pub fn single_limit_order(params: LimitOrderParams) -> ActionRequest
Sourcepub fn single_trigger_order(params: TriggerOrderParams) -> ActionRequest
pub fn single_trigger_order(params: TriggerOrderParams) -> ActionRequest
Create a single trigger order action directly (convenience method)
§Example
ⓘ
let action = OrderBuilder::single_trigger_order(
TriggerOrderParamsBuilder::default()
.asset(0)
.is_buy(false)
.px("39000.0")
.sz("0.01")
.reduce_only(false)
.is_market(true)
.trigger_px("39500.0")
.tpsl(TpSlRequest::Sl)
.build()
.unwrap()
);Trait Implementations§
Source§impl Debug for OrderBuilder
impl Debug for OrderBuilder
Source§impl Default for OrderBuilder
impl Default for OrderBuilder
Source§fn default() -> OrderBuilder
fn default() -> OrderBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OrderBuilder
impl RefUnwindSafe for OrderBuilder
impl Send for OrderBuilder
impl Sync for OrderBuilder
impl Unpin for OrderBuilder
impl UnsafeUnpin for OrderBuilder
impl UnwindSafe for OrderBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more