pub struct ReplaceOrderRequest {
pub oid: String,
pub p: Option<Decimal>,
pub q: Option<u64>,
pub po: Option<bool>,
pub tif: Option<AxTimeInForce>,
pub trigger_price: Option<Decimal>,
}Expand description
Request body for POST /replace_order.
Replaces (amends) an existing order. Unspecified optional fields inherit from the original order. The exchange returns a new order ID.
§References
Fields§
§oid: StringOrder ID to replace.
p: Option<Decimal>New limit price (optional, inherits from original if omitted).
q: Option<u64>New quantity in contracts (optional, inherits from original if omitted).
po: Option<bool>New post-only flag (optional, inherits from original if omitted).
tif: Option<AxTimeInForce>New time-in-force (optional, inherits from original if omitted).
trigger_price: Option<Decimal>New trigger price for stop orders (optional).
Implementations§
Source§impl ReplaceOrderRequest
impl ReplaceOrderRequest
Sourcepub fn new(order_id: impl Into<String>) -> Self
pub fn new(order_id: impl Into<String>) -> Self
Creates a new ReplaceOrderRequest with only the order ID.
Use the builder methods to set the fields to amend.
Sourcepub fn with_price(self, price: Decimal) -> Self
pub fn with_price(self, price: Decimal) -> Self
Sets the new limit price.
Sourcepub fn with_quantity(self, quantity: u64) -> Self
pub fn with_quantity(self, quantity: u64) -> Self
Sets the new quantity.
Sourcepub fn with_trigger_price(self, trigger_price: Decimal) -> Self
pub fn with_trigger_price(self, trigger_price: Decimal) -> Self
Sets the new trigger price.
Trait Implementations§
Source§impl Clone for ReplaceOrderRequest
impl Clone for ReplaceOrderRequest
Source§fn clone(&self) -> ReplaceOrderRequest
fn clone(&self) -> ReplaceOrderRequest
Returns a duplicate of the value. Read more
1.0.0 · 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 ReplaceOrderRequest
impl Debug for ReplaceOrderRequest
Source§impl<'de> Deserialize<'de> for ReplaceOrderRequest
impl<'de> Deserialize<'de> for ReplaceOrderRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReplaceOrderRequest
impl RefUnwindSafe for ReplaceOrderRequest
impl Send for ReplaceOrderRequest
impl Sync for ReplaceOrderRequest
impl Unpin for ReplaceOrderRequest
impl UnsafeUnpin for ReplaceOrderRequest
impl UnwindSafe for ReplaceOrderRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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