pub fn put() -> impl Filter<Extract = (), Error = Rejection> + Copy
Expand description

Create a Filter that requires the request method to be PUT.

Example

use warp::Filter;

let put_only = warp::put().map(warp::reply);
Examples found in repository?
examples/todos.rs (line 75)
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)
    }