pub struct Order {
pub id: OrderId,
pub side: Side,
pub price: Price,
pub original_quantity: Quantity,
pub remaining_quantity: Quantity,
pub filled_quantity: Quantity,
pub timestamp: Timestamp,
pub time_in_force: TimeInForce,
pub status: OrderStatus,
/* private fields */
}Expand description
An order in the order book.
Fields§
§id: OrderIdUnique identifier assigned by exchange
side: SideBuy or sell
price: PriceLimit price (max for buy, min for sell)
original_quantity: QuantityOriginal quantity when submitted
remaining_quantity: QuantityQuantity still available to fill
filled_quantity: QuantityQuantity that has been filled
timestamp: TimestampWhen the order was received by exchange
time_in_force: TimeInForceHow long the order stays active
status: OrderStatusCurrent lifecycle status
Implementations§
Source§impl Order
impl Order
Sourcepub fn new(
id: OrderId,
side: Side,
price: Price,
quantity: Quantity,
timestamp: Timestamp,
time_in_force: TimeInForce,
) -> Self
pub fn new( id: OrderId, side: Side, price: Price, quantity: Quantity, timestamp: Timestamp, time_in_force: TimeInForce, ) -> Self
Create a new order with the given parameters.
The order starts with remaining_quantity == original_quantity,
filled_quantity == 0, and status == New.
Trait Implementations§
impl Eq for Order
impl StructuralPartialEq for Order
Auto Trait Implementations§
impl Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnwindSafe for Order
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