#[derive(Debug, Clone)]
pub enum OrderSide {
Buy,
Sell,
}
#[derive(Debug, Clone)]
pub enum OrderType {
Market,
Limit,
}
#[derive(Debug, Clone)]
pub struct Order {
pub id: String,
pub symbol: String,
pub side: OrderSide,
pub order_type: OrderType,
pub quantity: u64,
pub price: f64,
}
impl Order {
pub fn new(id: String, symbol: String, side: OrderSide, order_type: OrderType, quantity: u64, price: f64) -> Self {
Self { id, symbol, side, order_type, quantity, price }
}
}
#[allow(dead_code)]
pub struct OrderBook {
symbol: String,
}
impl OrderBook {
pub fn new(symbol: String) -> Self {
Self { symbol }
}
}