From d35534c0795caeda46e57fc515b74eba701110a2 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 6 Dec 2019 18:00:04 +0100 Subject: initial commit --- src/api/skills.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/api/skills.rs (limited to 'src/api/skills.rs') diff --git a/src/api/skills.rs b/src/api/skills.rs new file mode 100644 index 0000000..9c692e1 --- /dev/null +++ b/src/api/skills.rs @@ -0,0 +1,24 @@ +//! Struct definitions for the skills API endpoint. +//! +//! * [Example](https://api.guildwars2.com/v2/skills/14375) +//! * [Wiki](https://wiki.guildwars2.com/wiki/API:2/skills) + +use super::HasId; +use serde::{Deserialize, Serialize}; + +#[derive(Deserialize, Serialize, Debug, Clone)] +pub struct Skill { + /// The skill id. + pub id: u32, + /// The skill name. + pub name: String, + /// A URL to an icon of the skill. + pub icon: String, +} + +impl HasId for Skill { + type Id = u32; + fn get_id(&self) -> u32 { + self.id + } +} -- cgit v1.2.3