summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-11 19:42:09 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-11 19:42:09 +0000
commit0e41bde5b8fca4451e7e39f9fdd4636f408850bb (patch)
tree2007b111ded4c5a1a831fd7c5aeb0d85c3e96c4c
parent7e60a4edcef897c3810fb4ae0564228fe853bf00 (diff)
Make all fields public
-rw-r--r--Cargo.toml3
-rw-r--r--src/lib.rs1
-rw-r--r--src/models.rs16
3 files changed, 13 insertions, 7 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f7e13b5..451a3ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "twitch_api"
-version = "0.0.2"
+version = "0.0.21"
authors = ["David Blajda <blajda@hotmail.com>"]
edition = "2018"
@@ -12,3 +12,4 @@ dotenv = "0.13.0"
serde = "1.0.81"
serde_json = "1.0.33"
serde_derive = "1.0.81"
+chrono = "0.4.6"
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<T> {
@@ -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)]