eversal-esi 0.1.0

Eve Online's ESI API library for Rust and Eversal projects
Documentation
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum MarketOrderType {
  Buy,
  Sell,
  All,
}

impl ToString for MarketOrderType {
  fn to_string(&self) -> String {
    match self {
      MarketOrderType::Buy => "buy".to_string(),
      MarketOrderType::Sell => "sell".to_string(),
      MarketOrderType::All => "all".to_string(),
    }
  }
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MarketOrder {
  pub duration: i32,
  pub is_buy_order: bool,
  pub issued: DateTime<Utc>,
  pub location_id: i64,
  pub min_volume: i32,
  pub order_id: i64,
  pub price: f32,
  pub range: String,
  pub system_id: i32,
  pub type_id: i32,
  pub volume_remain: f32,
  pub volume_total: f32,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct MarketHistory {
  pub average: f32,
  pub date: String,
  pub highest: f32,
  pub lowest: f32,
  pub order_count: i32,
  pub volume: i64,
}