summaryrefslogtreecommitdiff
path: root/src/kraken/endpoints.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-13 20:56:55 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-13 20:56:55 +0000
commit8615cc2f030240ba2982dba893fe63f11a0c8a88 (patch)
tree30c7103625323404696331c2384130ce06f8bc96 /src/kraken/endpoints.rs
parent54bcdf63d941dbbd0b3e565259515f013f1ecd13 (diff)
Restructure project and included kraken endpoint
Diffstat (limited to 'src/kraken/endpoints.rs')
-rw-r--r--src/kraken/endpoints.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kraken/endpoints.rs b/src/kraken/endpoints.rs
new file mode 100644
index 0000000..2dbc8d1
--- /dev/null
+++ b/src/kraken/endpoints.rs
@@ -0,0 +1,20 @@
+use futures::Future;
+use super::models::Clip;
+use super::Client;
+
+use super::API_DOMAIN;
+
+impl Client {
+ pub fn clip(&self, id: &str)
+ -> impl Future<Item=Clip, Error=reqwest::Error>
+ {
+ let url = String::from("https://") + API_DOMAIN + "/kraken/clips/" + id;
+ let client = self.create_reqwest_client();
+
+ client
+ .get(&url)
+ .send()
+ .map(|mut res| res.json::<Clip>())
+ .and_then(|json| json)
+ }
+}