redgold 0.1.0

A relative proof conflict resolution & irreversibility service with trust modeling custodial pooling and executor contracts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::future::Future;
use futures::future::{Fuse, Map};
use warp::Rejection;
use futures::FutureExt;
use redgold_schema::structs::ErrorInfo;

// this did not work out right due to type signatures
// pub(crate) fn apply_rejection<RespT, Fut, T, ReqT, FutOut>(
//     handler: fn(T, ReqT) -> Fut,
// ) -> fn(T, ReqT) -> Fut
//     where Fut: Future<Output = Result<RespT, ErrorInfo>> + Send,
//     FutOut: Future<Output = Result<Result<RespT, ErrorInfo>, Rejection>> + Send,
// {
//     |x,y| handler(x,y).map(|t| {
//         let result: Result<Result<RespT, ErrorInfo>, Rejection> = Ok::<Result<RespT, ErrorInfo>, Rejection>(t);
//         result
//     })
// }