Skip to content

Commit

Permalink
feat(layout): improved module layout
Browse files Browse the repository at this point in the history
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 ... .
  • Loading branch information
Byron committed Feb 28, 2015
1 parent 67b052c commit 24a727f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/videos/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub use self::service::*;

mod service;
12 changes: 8 additions & 4 deletions src/videos.rs → src/videos/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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,
}
Expand Down

0 comments on commit 24a727f

Please sign in to comment.