pub struct OrderCore {Show 37 fields
pub events: Vec<OrderEventAny>,
pub commissions: HashMap<Currency, Money>,
pub venue_order_ids: Vec<VenueOrderId>,
pub trade_ids: Vec<TradeId>,
pub previous_status: Option<OrderStatus>,
pub status: OrderStatus,
pub trader_id: TraderId,
pub strategy_id: StrategyId,
pub instrument_id: InstrumentId,
pub client_order_id: ClientOrderId,
pub venue_order_id: Option<VenueOrderId>,
pub position_id: Option<PositionId>,
pub account_id: Option<AccountId>,
pub last_trade_id: Option<TradeId>,
pub side: OrderSide,
pub order_type: OrderType,
pub quantity: Quantity,
pub time_in_force: TimeInForce,
pub liquidity_side: Option<LiquiditySide>,
pub is_reduce_only: bool,
pub is_quote_quantity: bool,
pub emulation_trigger: Option<TriggerType>,
pub contingency_type: Option<ContingencyType>,
pub order_list_id: Option<OrderListId>,
pub linked_order_ids: Option<Vec<ClientOrderId>>,
pub parent_order_id: Option<ClientOrderId>,
pub exec_algorithm_id: Option<ExecAlgorithmId>,
pub exec_algorithm_params: Option<HashMap<Ustr, Ustr>>,
pub exec_spawn_id: Option<ClientOrderId>,
pub tags: Option<Vec<Ustr>>,
pub filled_qty: Quantity,
pub leaves_qty: Quantity,
pub avg_px: Option<f64>,
pub slippage: Option<f64>,
pub init_id: UUID4,
pub ts_init: UnixNanos,
pub ts_last: UnixNanos,
}
Fields§
§events: Vec<OrderEventAny>
§commissions: HashMap<Currency, Money>
§venue_order_ids: Vec<VenueOrderId>
§trade_ids: Vec<TradeId>
§previous_status: Option<OrderStatus>
§status: OrderStatus
§trader_id: TraderId
§strategy_id: StrategyId
§instrument_id: InstrumentId
§client_order_id: ClientOrderId
§venue_order_id: Option<VenueOrderId>
§position_id: Option<PositionId>
§account_id: Option<AccountId>
§last_trade_id: Option<TradeId>
§side: OrderSide
§order_type: OrderType
§quantity: Quantity
§time_in_force: TimeInForce
§liquidity_side: Option<LiquiditySide>
§is_reduce_only: bool
§is_quote_quantity: bool
§emulation_trigger: Option<TriggerType>
§contingency_type: Option<ContingencyType>
§order_list_id: Option<OrderListId>
§linked_order_ids: Option<Vec<ClientOrderId>>
§parent_order_id: Option<ClientOrderId>
§exec_algorithm_id: Option<ExecAlgorithmId>
§exec_algorithm_params: Option<HashMap<Ustr, Ustr>>
§exec_spawn_id: Option<ClientOrderId>
§filled_qty: Quantity
§leaves_qty: Quantity
§avg_px: Option<f64>
§slippage: Option<f64>
§init_id: UUID4
§ts_init: UnixNanos
§ts_last: UnixNanos
Implementations§
Source§impl OrderCore
impl OrderCore
Sourcepub fn new(init: OrderInitialized) -> Self
pub fn new(init: OrderInitialized) -> Self
Creates a new OrderCore
instance.
pub fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
pub fn set_slippage(&mut self, price: Price)
pub fn opposite_side(side: OrderSide) -> OrderSide
pub fn closing_side(side: PositionSide) -> OrderSide
pub fn signed_decimal_qty(&self) -> Decimal
pub fn would_reduce_only( &self, side: PositionSide, position_qty: Quantity, ) -> bool
pub fn commission(&self, currency: &Currency) -> Option<Money>
pub fn commissions(&self) -> HashMap<Currency, Money>
pub fn init_event(&self) -> Option<OrderEventAny>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OrderCore
impl<'de> Deserialize<'de> for OrderCore
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 OrderCore
impl RefUnwindSafe for OrderCore
impl Send for OrderCore
impl Sync for OrderCore
impl Unpin for OrderCore
impl UnwindSafe for OrderCore
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