in_space_core/
lib.rs

1//pub trait Response {
2//    fn into_json(self) -> warp::reply::Json;
3//}
4//
5//pub type Result<T: Response, F> = std::result::Result<T, F>;
6//
7//pub trait Conversions {
8//    fn into_warp_result(self) -> std::result::Result<warp::reply::Json, std::convert::Infallible>;
9//}
10//
11//impl<T: Response, F> Conversions for Result<T, F> {
12//    fn into_warp_result(self) -> std::result::Result<warp::reply::Json, std::convert::Infallible> {
13//        todo!()
14//    }
15//}
16
17pub trait Middleware {
18    type Output;
19}
20
21impl<T, Fil: warp::Filter<Extract = (T,)>, F: Fn() -> Fil> Middleware for F {
22    type Output = T;
23}
24
25#[cfg(test)]
26mod tests {
27    #[test]
28    fn it_works() {
29        assert_eq!(2 + 2, 4);
30    }
31}