pooly 0.2.1

A protobuf to Postgres adapter + connection pooling middleware.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

pub struct ResponseWithCode<T>(pub T, pub u16);

impl<T> ResponseWithCode<T> {

    pub fn ok(response: T) -> ResponseWithCode<T> {
        ResponseWithCode(response, 200)
    }

    pub fn map<F, R>(self,
                     fun: F) -> ResponseWithCode<R>
        where F: FnOnce(T) -> R {
        ResponseWithCode(fun(self.0), self.1)
    }

}