1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Types related to tracks returned by the [Exercism website](https://exercism.org) v2 API.
use serde::{Deserialize, Serialize};
/// A single language track returned by the [Exercism website](https://exercism.org) v2 API.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Track {
/// Name of the language track.
///
/// This is an internal name, like `common-lisp`. Also called `slug`.
#[serde(rename = "slug")]
pub name: String,
/// Language track title.
///
/// This is a textual representation of the track name, like `Common Lisp`.
pub title: String,
/// Total number of concepts taught by the track.
pub num_concepts: usize,
/// Total number of exercises available in the track.
pub num_exercises: usize,
/// URL of this language track on the [Exercism website](https://exercism.org).
pub web_url: String,
/// URL of the icon representing this language track on the [Exercism website](https://exercism.org).
pub icon_url: String,
/// List of tags attached to this language track.
///
/// Can contain many information, like `Object-oriented`, `Linux`, etc.
pub tags: Vec<String>,
/// Links pertaining to the language track.
pub links: Links,
/// Whether this track has been joined by the user.
///
/// Will be set to `false` for anonymous queries or unjoined tracks.
#[serde(default)]
pub is_joined: bool,
/// Number of concepts learnt by the user in this track.
///
/// Will be set to `0` for anonymous queries or unjoined tracks.
#[serde(default)]
pub num_learnt_concepts: usize,
/// Number of exercises completed by the user in this track.
///
/// Will be set to `0` for anonymous queries or unjoined tracks.
#[serde(default)]
pub num_completed_exercises: usize,
}
/// Links pertaining to an [Exercism](https://exercism.org) language track returned by the v2 API.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Links {
/// URL of the language track on the [Exercism website](https://exercism.org).
///
/// Corresponds to the track's [`web_url`](Track::web_url).
#[serde(rename = "self")]
pub self_url: String,
/// URL of the language track's exercises on the [Exercism website](https://exercism.org).
pub exercises: String,
/// URL of the language track's concepts on the [Exercism website](https://exercism.org).
pub concepts: String,
}