Function warp::reply::with_status

source ·
pub fn with_status<T: Reply>(reply: T, status: StatusCode) -> WithStatus<T>
Expand description

Wrap an impl Reply to change its StatusCode.

§Example

use warp::Filter;

let route = warp::any()
    .map(warp::reply)
    .map(|reply| {
        warp::reply::with_status(reply, warp::http::StatusCode::CREATED)
    });