Warp is returning the error,
error[E0277]: the trait bound `impl warp::Future: warp::filter::FilterBase` is not satisfied
--> src/http.rs:31:26
|
31 | let routes = index().or(users());
| ^^^^^^^ the trait `warp::filter::FilterBase` is not implemented for `impl warp::Future`
I have essentially this,
pub async fn users() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
# stuff
}
What am I doing wrong?
or
takes a functions that returns aFilter
. Your function is markedasync
, and returns aFuture<Output = Filter>
. You can instead useor_else
, the async version ofor
: