binance-client 1.7.0

The Binance cryptocurrency exchange client
Documentation
//!
//! The order side.
//!

use serde::Deserialize;
use std::fmt::Formatter;

///
/// The order side.
///
#[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum OrderSide {
    /// The buy order.
    Buy,
    /// The sell order.
    Sell,
}

impl std::fmt::Display for OrderSide {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Buy => write!(f, "BUY"),
            Self::Sell => write!(f, "SELL"),
        }
    }
}