Expand description
Create a Filter
that requires the request method to be PUT
.
use warp::Filter;
let put_only = warp::put().map(warp::reply);
71
72
73
74
75
76
77
78
79
pub fn todos_update(
db: Db,
) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
warp::path!("todos" / u64)
.and(warp::put())
.and(json_body())
.and(with_db(db))
.and_then(handlers::update_todo)
}