From 0e41bde5b8fca4451e7e39f9fdd4636f408850bb Mon Sep 17 00:00:00 2001 From: David Blajda Date: Tue, 11 Dec 2018 19:42:09 +0000 Subject: Make all fields public --- src/lib.rs | 1 + src/models.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index f0a01b9..37c89ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ extern crate futures; extern crate reqwest; extern crate serde; +extern crate chrono; #[macro_use] extern crate serde_derive; diff --git a/src/models.rs b/src/models.rs index 6aec705..52c4781 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,4 +1,8 @@ extern crate serde_json; +extern crate chrono; + +use chrono::{Duration, DateTime, Utc}; + #[derive(Debug, Deserialize)] pub struct DataContainer { @@ -28,14 +32,14 @@ pub struct Video { pub published_at: String, //Should be converted to a URL pub url: String, - thumbnail_url: String, - viewable: String, - view_count: i32, - language: String, + pub thumbnail_url: String, + pub viewable: String, + pub view_count: i32, + pub language: String, #[serde(rename = "type")] - video_type: String, + pub video_type: String, //Should be converted to a Duration - duration: String, + pub duration: String, } #[derive(Debug, Deserialize)] -- cgit v1.2.3