diff options
author | Daniel Schadt <kingdread@gmx.de> | 2019-12-06 18:00:04 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2019-12-06 18:00:04 +0100 |
commit | d35534c0795caeda46e57fc515b74eba701110a2 (patch) | |
tree | 61036c13c2ce1b7caaf372043471bab4d0f4acd7 /src/api/specializations.rs | |
download | kondou-d35534c0795caeda46e57fc515b74eba701110a2.tar.gz kondou-d35534c0795caeda46e57fc515b74eba701110a2.tar.bz2 kondou-d35534c0795caeda46e57fc515b74eba701110a2.zip |
initial commit
Diffstat (limited to 'src/api/specializations.rs')
-rw-r--r-- | src/api/specializations.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/api/specializations.rs b/src/api/specializations.rs new file mode 100644 index 0000000..97fc289 --- /dev/null +++ b/src/api/specializations.rs @@ -0,0 +1,34 @@ +//! Struct definitions for the specializations API endpoint. +//! +//! * [Example](https://api.guildwars2.com/v2/specializations/1) +//! * [Wiki](https://wiki.guildwars2.com/wiki/API:2/specializations) + +use super::HasId; +use serde::{Deserialize, Serialize}; + +#[derive(Deserialize, Serialize, Debug, Clone)] +pub struct Specialization { + /// The specialization's ID. + pub id: u32, + /// The name of the specialization. + pub name: String, + /// The profession that this specialization belongs to. + pub profession: String, + /// `true` if this specialization is an elite specialization, `false` otherwise. + pub elite: bool, + /// A URL to an icon of the specialization. + pub icon: String, + /// An URL to the background image of the specialization. + pub background: String, + /// Contains a list of IDs specifying the minor traits in the specialization. + pub minor_traits: Vec<u32>, + /// Contains a list of IDs specifying the major traits in the specialization. + pub major_traits: Vec<u32>, +} + +impl HasId for Specialization { + type Id = u32; + fn get_id(&self) -> u32 { + self.id + } +} |