Struct bourse_de::types::Order

source ·
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

source

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 time
  • vol - Order volume
  • price - Limit price of the order
  • trader_id - Id of the agent/trader
  • order_id - Id of the order
source

pub fn buy_market(t: u64, vol: u32, trader_id: u32, order_id: usize) -> Order

Initialise a buy market-order

§Arguments
  • t - Order creation time
  • vol - Order volume
  • trader_id - Id of the agent/trader
  • order_id - Id of the order
source

pub fn sell_limit( t: u64, vol: u32, price: u32, trader_id: u32, order_id: usize ) -> Order

Initialise a sell limit-order

§Arguments
  • t - Order creation time
  • vol - Order volume
  • price - Limit price of the order
  • trader_id - Id of the agent/trader
  • order_id - Id of the order
source

pub fn sell_market(t: u64, vol: u32, trader_id: u32, order_id: usize) -> Order

Initialise a sell market-order

§Arguments
  • t - Order creation time
  • vol - Order volume
  • trader_id - Id of the agent/trader
  • order_id - Id of the order

Trait Implementations§

source§

impl Clone for Order

source§

fn clone(&self) -> Order

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'de> Deserialize<'de> for Order

source§

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

source§

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
source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,