From 8615cc2f030240ba2982dba893fe63f11a0c8a88 Mon Sep 17 00:00:00 2001 From: David Blajda Date: Thu, 13 Dec 2018 20:56:55 +0000 Subject: Restructure project and included kraken endpoint --- src/kraken/endpoints.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/kraken/endpoints.rs (limited to 'src/kraken/endpoints.rs') 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 + { + 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::()) + .and_then(|json| json) + } +} -- cgit v1.2.3