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/professions.rs | |
download | kondou-d35534c0795caeda46e57fc515b74eba701110a2.tar.gz kondou-d35534c0795caeda46e57fc515b74eba701110a2.tar.bz2 kondou-d35534c0795caeda46e57fc515b74eba701110a2.zip |
initial commit
Diffstat (limited to 'src/api/professions.rs')
-rw-r--r-- | src/api/professions.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/api/professions.rs b/src/api/professions.rs new file mode 100644 index 0000000..2716a1a --- /dev/null +++ b/src/api/professions.rs @@ -0,0 +1,36 @@ +//! Struct definitions for the professions API endpoint. +//! +//! * [Example](https://api.guildwars2.com/v2/professions/Engineer) +//! * [Wiki](https://wiki.guildwars2.com/wiki/API:2/professions) + +use super::HasId; +use serde::{Deserialize, Serialize}; + +#[derive(Deserialize, Serialize, Debug, Clone)] +pub struct Profession { + /// The profession id. + pub id: String, + /// The name of the profession. + pub name: String, + /// List of specialization ids. + pub specializations: Vec<u32>, + /// List of skills. + pub skills: Vec<Skill>, +} + +impl HasId for Profession { + type Id = String; + fn get_id(&self) -> String { + self.id.clone() + } +} + +#[derive(Deserialize, Serialize, Debug, Clone)] +pub struct Skill { + /// The id of the skill. + pub id: u32, + /// The skill bar slot that this skill can be used in. + pub slot: String, + #[serde(rename = "type")] + pub typ: String, +} |