ddapi-rs 0.10.0

A simple Rust library to get data from DDNet and DDStats APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::prelude::encode;
use crate::scheme::DDNET_BASE_URL;
use serde_derive::{Deserialize, Serialize};

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct QueryMap {
    pub name: String,
    pub r#type: String,
    pub mapper: String,
}

impl QueryMap {
    pub fn api(map: &str) -> String {
        format!("https://{}/maps/?query={}", DDNET_BASE_URL, encode(map))
    }
}