1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//! //! The order side. //! use serde::Deserialize; /// /// The order side. /// #[derive(Debug, Deserialize)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum OrderSide { /// The buy order. Buy, /// The sell order. Sell, } impl ToString for OrderSide { fn to_string(&self) -> String { match self { Self::Buy => "BUY", Self::Sell => "SELL", } .to_owned() } }