nttb-api 0.1.0

A interface for interacting with the NTTB Api
Documentation
use serde::Deserialize;
use serde_with::{serde_as,json::JsonString};

#[derive(Deserialize,Debug)]
pub enum Gender {
    #[serde(rename="M")]
    Male,
    #[serde(rename="V")]
    Female,
    #[serde(rename="")]
    Unassigned
}
#[derive(Deserialize,Debug)]

pub struct SearchResultPlayer {
    #[serde(rename="BNo")]
    ///A unique number assigned to each player in the database
    pub bondsnumber:u64,
    ///The player's name in the form of: Last-Name, First-Name-Initials Infix-if-any (First-Names)
    pub name:String,
    ///The gender class of the player. `Unassigned` in this case means that the gender class of the player isn't publicly viewable
    pub gender:Gender,
    #[serde(rename="foto")]
    ///Some people have a picture assigned to their search result, respect that. The picture endpoint is https://www.nttb-ranglijsten.nl/foto/
    pub photo:Option<String>

}
#[serde_as]
#[derive(Deserialize,Debug)]
pub struct SearchResult {
    username:u64,
    player:u64,
    #[serde_as(as = "JsonString")]
    pub list:Vec<SearchResultPlayer>
}