I have a future that I’m trying to store in a custom combinator. It’s always the same type:
tokio::timer::Delay with an error mapped to
() (for simplicity’s sake, though I may want to change this later).
let expire = Delay::new(expiry_time)
I don’t know how to store this. Its type is
MapErr<Delay, [closure]>, and when I try to box the closure, it won’t work with the
Oh sorry, should have read more closely that you already tried boxing, but you just tried boxing the closure. Try boxing the whole future, unless there’s a reason not to do that.
Can also store it in
MapErr<Delay, fn(Error)> if you need to name the type.
Box<Future<Item=(), Error=()>> ended up working out well! I think I had tried boxing the whole future, but I hadn’t specified some of the types correctly.