minehut 1.0.1

Simple Rust wrapper for the Minehut API
Documentation
use serde::Deserialize;

#[derive(Deserialize)]
/// This struct represents the Minehut server response.
pub struct ServerInfo {
    /// This is the actual server data.
    pub server: Server
}

#[derive(Debug, Deserialize)]
/// This struct represents a Minehut server.
pub struct Server {
    pub categories: Vec<String>,
    #[serde(rename = "inheritedCategories")]
    pub inherited_categories: Vec<String>,
    pub purchased_icons: Vec<String>,
    pub backup_slots: usize,
    pub suspended: bool,
    pub server_version_type: String,
    pub proxy: bool,
    #[serde(rename = "connectedServers")]
    pub connected_servers: Vec<String>,
    #[serde(rename = "_id")]
    pub id: String,
    pub motd: String,
    pub visibility: bool,
    pub server_plan: String,
    pub storage_node: String,
    pub owner: String,
    pub name: String,
    pub name_lower: String,
    pub creation: usize,
    pub platform: String,
    pub credits_per_day: f32,
    __v: isize,
    pub last_online: usize,
    pub active_icon: String,
    pub icon: String,
    pub online: bool,
    #[serde(rename = "maxPlayers")]
    pub max_players: usize,
    #[serde(rename = "playerCount")]
    pub player_count: usize,
    #[serde(rename = "rawPlan")]
    pub raw_plan: String,
    #[serde(rename = "activeServerPlan")]
    pub active_server_plan: String
}

#[derive(Debug, Deserialize)]
/// This struct represents a server icon.
pub struct ServerIcon {
    #[serde(rename = "_id")]
    pub id: String,
    pub display_name: String,
    pub icon_name: String,
    pub price: usize,
    pub rank: String,
    pub available: bool,
    pub disabled: bool,
    pub created: usize,
    pub last_updated: usize,
    __v: isize
}

#[derive(Deserialize)]
/// This struct represents the response for a server list.

pub struct ServerList {
    /// actual data
    pub servers: Vec<ServerListData> 
}

/// This struct represents the server data obtained from server list.
/// It is different from the normal Server struct due to how Minehut
/// structured the response.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerListData {
    pub static_info: StaticInfo,
    pub name: String,
    pub motd: String,
    pub icon: Option<String>,
    pub player_data: PlayerData,
    pub connectable: Option<bool>,
    pub visibility: bool
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Static information for the ServerListData struct
pub struct StaticInfo {
    #[serde(rename = "_id")]
    pub id: String,
    pub server_plan: String,
    pub service_start_date: usize,
    pub platform: String,
    #[serde(rename = "planMaxPlayers")]
    pub max_players: usize,
    pub raw_plan: String,
    pub connected_servers: Vec<String>
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Player data struct to deserialize from ServerListData
pub struct PlayerData {
    pub player_count: usize,
}