lichess-api 1.0.0

A client library for the Lichess API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::model::Request;
use serde::Serialize;

#[derive(Default, Clone, Debug, Serialize)]
pub struct GetQuery {
    #[serde(skip_serializing_if = "Option::is_none")]
    matchup: Option<bool>,
}

pub type GetRequest = Request<GetQuery>;

impl GetRequest {
    pub fn new(user1: &str, user2: &str, matchup: Option<bool>) -> Self {
        let path = format!("/api/crosstable/{user1}/{user2}");
        Self::get(path, GetQuery { matchup }, None)
    }
}