1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use response::{Meta, Links};

#[derive(Deserialize, Debug, Clone)]
pub struct Pages {
    pub first: Option<String>,
    pub prev: Option<String>,
    pub next: Option<String>,
    pub last: Option<String>
}

#[derive(Deserialize)]
pub struct RawPagedResponse<T> {
    pub collection: Vec<T>,
    pub links: Links,
    pub meta: Meta
}

pub trait NewIter {
    type Item;
    fn new() -> Vec<Self::Item> {
        vec![]
    }
}

impl<R> NewIter for R
              where R: Iterator {
    type Item = <Self as Iterator>::Item;
}