Warp: Returning BoxedFilter from function

Hi! New warp user here. I'm trying to return an or'ed filter from a function, but I don't uderstand what it wants from me.
I think that the issue is that Or's Exact assiciated type is this:
Extract = (Either<T::Extract, U::Extract>,) and BoxedFilter expects it, but the Either type is private.

I can try to rework the code to not bother with function return, but I'm curious what could be a solution.

fn api_entry(state: State) -> BoxedFilter<(impl Reply, )>  // WHAT is a correct type here?{
.....
    warp::path::end()
        .or(session_get)
        .or(session_stop)
        .or(new_task).boxed()
}
fn api_entry(state: State) -> BoxedFilter<(impl Reply,)> {
   |                                            ^^^^^^^^^^ the trait `warp::Reply` is not implemented for `()`
   |
   = note: required because of the requirements on the impl of `warp::Reply` for `warp::generic::Either<(), (impl warp::Reply,)>`
   = note: 4 redundant requirements hidden
   = note: required because of the requirements on the impl of `warp::Reply` for `warp::generic::Either<(warp::generic::Either<(warp::generic::Either<(), (impl warp::Reply,)>,), (impl warp::Reply,)>,), (impl warp::Reply,)>`

It's because unlike those other arms, the warp::path::end() doesn't yields any reply. Easy fix would be to remove it and put the session_get at the top.

Thanks Heyonu, that worked!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.