From 24a727fdea7c2ae47dd23b7ff571cd717ec4d870 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 28 Feb 2015 16:44:04 +0100 Subject: [PATCH] feat(layout): improved module layout As there will be plenty of types, it will be better to split it up. Also learned something about self:: :). Insert and and update should be hand-implemented just to see how it's working. Then there should be some investment to auto-generate this with `gsl`. Once the latter works ... I could auto-generate all apis, or adjust the go generator to create rust instead. Depends on what will be faster ... . --- src/videos/mod.rs | 3 +++ src/{videos.rs => videos/service.rs} | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/videos/mod.rs rename src/{videos.rs => videos/service.rs} (61%) diff --git a/src/videos/mod.rs b/src/videos/mod.rs new file mode 100644 index 00000000000..86790a92ca4 --- /dev/null +++ b/src/videos/mod.rs @@ -0,0 +1,3 @@ +pub use self::service::*; + +mod service; \ No newline at end of file diff --git a/src/videos.rs b/src/videos/service.rs similarity index 61% rename from src/videos.rs rename to src/videos/service.rs index 684f0ecf61a..5bb2dc15add 100644 --- a/src/videos.rs +++ b/src/videos/service.rs @@ -2,9 +2,13 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::marker::PhantomData; +use rustc_serialize; + use hyper; -pub struct VideosService<'a, C, NC> + +/// The videos service - provides actual functionality through builders. +pub struct Service<'a, C, NC> where NC: 'a, C: 'a { @@ -13,12 +17,12 @@ pub struct VideosService<'a, C, NC> _m: PhantomData } -impl<'a, C, NC> VideosService<'a, C, NC> +impl<'a, C, NC> Service<'a, C, NC> where NC: hyper::net::NetworkConnector, C: BorrowMut> + 'a { - pub fn new(client: &'a RefCell) -> VideosService<'a, C, NC> { - VideosService { + pub fn new(client: &'a RefCell) -> Service<'a, C, NC> { + Service { client: client, _m: PhantomData, }