diff options
Diffstat (limited to 'hackernews_tui/src/client/model.rs')
-rw-r--r-- | hackernews_tui/src/client/model.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/hackernews_tui/src/client/model.rs b/hackernews_tui/src/client/model.rs index 82ba8c3..7ae04fe 100644 --- a/hackernews_tui/src/client/model.rs +++ b/hackernews_tui/src/client/model.rs @@ -60,8 +60,21 @@ pub struct StoryResponse { } #[derive(Debug, Deserialize)] -/// HNStoryResponse represents the story data received from the official HackerNews APIs -pub struct HNStoryResponse { +/// ItemResponse represents the item data received from the official HackerNews APIs +pub struct ItemResponse { + pub id: u32, + pub by: Option<String>, + pub text: Option<String>, + pub title: Option<String>, + pub url: Option<String>, + + #[serde(rename(deserialize = "type"))] + pub typ: String, + + pub descendants: Option<usize>, + pub score: Option<u32>, + pub time: u64, + #[serde(default)] pub kids: Vec<u32>, } |