pub fn permanent(uri: impl AsLocation) -> impl Reply
Expand description

A simple 308 permanent redirect to a different location.

This is similar to redirect but the HTTP method of the request to the new location will be the same as the method of the current request.

Example

use warp::{http::Uri, Filter};

let route = warp::path("v1")
    .map(|| {
        warp::redirect::permanent(Uri::from_static("/v2"))
    });