pub struct Order {
pub client_id: u64,
pub instrument: InstrumentId,
pub side: Side,
pub qty: Quantity,
pub limit: Option<Price>,
pub status: OrderStatus,
pub filled: Quantity,
pub account_id: String,
pub trace: Option<OrderTrace>,
pub policy: Option<OrderPolicy>,
pub exact_amounts: Option<ExactOrderAmounts>,
}Fields§
§client_id: u64§instrument: InstrumentId§side: Side§qty: Quantity§limit: Option<Price>None 表示市价单。
status: OrderStatus§filled: Quantity§account_id: String§trace: Option<OrderTrace>§policy: Option<OrderPolicy>现货/保证金/永续/期货的执行策略;None 保持现货 Cash/1x 兼容语义。
exact_amounts: Option<ExactOrderAmounts>Versioned high-precision amount payload. Omitted on all legacy 1e9 orders.
Implementations§
Source§impl Order
impl Order
Sourcepub fn same_submission_identity(&self, other: &Order) -> bool
pub fn same_submission_identity(&self, other: &Order) -> bool
Compare immutable submission facts while ignoring the lifecycle state and cumulative fills, which may have advanced since the original submission was persisted. A reused client order ID is idempotent only when every economic and routing input matches the original request.
Sourcepub fn same_amendment_lineage(&self, other: &Order) -> bool
pub fn same_amendment_lineage(&self, other: &Order) -> bool
Compare stable order identity while allowing quantity, price, or conditional terms to evolve through a confirmed amendment.
pub fn validate(&self) -> Result<(), String>
Sourcepub fn require_legacy_amounts(&self) -> Result<(), String>
pub fn require_legacy_amounts(&self) -> Result<(), String>
Guard a legacy 1e9 consumer against silently reading an exact amount as zero.
pub fn remaining(&self) -> Quantity
Sourcepub fn quantity_decimal(&self) -> ExactDecimal
pub fn quantity_decimal(&self) -> ExactDecimal
Exact quantity including a high-precision payload when present.
pub fn quote_budget_decimal(&self) -> Option<ExactDecimal>
pub fn quote_filled_decimal(&self) -> ExactDecimal
Sourcepub fn remaining_budget_decimal(&self) -> Option<ExactDecimal>
pub fn remaining_budget_decimal(&self) -> Option<ExactDecimal>
Remaining amount in the order’s declared sizing unit. For quote-budget orders this
is quote currency; consumers doing quantity/exposure math must use remaining_decimal.
pub fn is_quote_budget_order(&self) -> bool
Sourcepub fn has_remaining_amount(&self) -> bool
pub fn has_remaining_amount(&self) -> bool
Whether any amount remains in the order’s own sizing unit.
pub fn filled_decimal(&self) -> ExactDecimal
pub fn limit_price_decimal(&self) -> Option<ExactDecimal>
Sourcepub fn market_reference_price_decimal(&self) -> Option<ExactDecimal>
pub fn market_reference_price_decimal(&self) -> Option<ExactDecimal>
Price used to value an exact pending order. A market order carries the fresh reference captured at admission so later reservations do not fall back to 1e-9.