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::<submodule> :).

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 ... .
This commit is contained in:
Sebastian Thiel
2015-02-28 16:44:04 +01:00
parent 67b052c5f3
commit 24a727fdea
2 changed files with 11 additions and 4 deletions

3
src/videos/mod.rs Normal file
View File

@@ -0,0 +1,3 @@
pub use self::service::*;
mod service;

View File

@@ -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<NC>
}
impl<'a, C, NC> VideosService<'a, C, NC>
impl<'a, C, NC> Service<'a, C, NC>
where NC: hyper::net::NetworkConnector,
C: BorrowMut<hyper::Client<NC>> + 'a {
pub fn new(client: &'a RefCell<C>) -> VideosService<'a, C, NC> {
VideosService {
pub fn new(client: &'a RefCell<C>) -> Service<'a, C, NC> {
Service {
client: client,
_m: PhantomData,
}