pub struct Order {
pub side: Side,
pub status: Status,
pub arr_time: u64,
pub end_time: u64,
pub vol: u32,
pub start_vol: u32,
pub price: u32,
pub trader_id: u32,
pub order_id: usize,
}
Expand description
Order data
Fields§
§side: Side
Order side
status: Status
Status of the order
arr_time: u64
Arrival time of the order
end_time: u64
End time of the order (filled, cancelled etc.)
vol: u32
Current volume of the order
start_vol: u32
Original volume when the order was placed
price: u32
Price of the order
trader_id: u32
Id of the trader/agent who placed the order
order_id: usize
Id of the order
Implementations§
source§impl Order
impl Order
sourcepub fn buy_limit(
t: u64,
vol: u32,
price: u32,
trader_id: u32,
order_id: usize
) -> Order
pub fn buy_limit( t: u64, vol: u32, price: u32, trader_id: u32, order_id: usize ) -> Order
Initialise a buy limit-order
§Arguments
t
- Order creation timevol
- Order volumeprice
- Limit price of the ordertrader_id
- Id of the agent/traderorder_id
- Id of the order
sourcepub fn buy_market(t: u64, vol: u32, trader_id: u32, order_id: usize) -> Order
pub fn buy_market(t: u64, vol: u32, trader_id: u32, order_id: usize) -> Order
Initialise a buy market-order
§Arguments
t
- Order creation timevol
- Order volumetrader_id
- Id of the agent/traderorder_id
- Id of the order
Trait Implementations§
source§impl<'de> Deserialize<'de> for Order
impl<'de> Deserialize<'de> for Order
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Order, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Order, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Order
impl Serialize for Order
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy 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