pub fn with_replacements<S: ToString>(https_to_http: bool, replacements: &[(S, S)]) -> Self {
        let replacements = replacements
            .iter()
            .map(|(a, b)| ((*a).to_string(), (*b).to_string()))
            .collect();
        RedirectScheme {
            https_to_http,
            replacements,
            ..Self::default()
        }
    }
/// Creates a RedirectScheme middleware which also performs string replacement on the final url.
/// This is useful when not running on the default web and ssl ports (80 and 443) since we will
/// need to change the development web port in the hostname to the development ssl port.
///
/// ## Usage
/// ```
/// extern crate actix_web_middleware_redirect_scheme;
///
/// use actix_web::{App, web, HttpResponse};
/// use actix_web_middleware_redirect_scheme::RedirectScheme;
///
/// App::new()
///     .wrap(RedirectScheme::with_replacements(false, &[(":8080", ":8443")]))
///     .route("/", web::get().to(|| HttpResponse::Ok()
///                                     .content_type("text/plain")
///                                     .body("Always HTTPS on non-default ports!")));
/// ```
Creates a RedirectScheme middleware which also performs string replacement on the final url.
This is useful when not running on the default web and ssl ports (80 and 443) since we will
need to change the development web port in the hostname to the development ssl port.
Creates a RedirectScheme middleware which also performs string replacement on the final url . This is useful when not running on the default web and ssl ports ( 80 and 443 ) since we will need to change the development web port in the hostname to the development ssl port .
pub fn with_replacements<S: ToString>(https_to_http: bool, replacements: &[(S, S)]) -> Self {
        let replacements = replacements
            .iter()
            .map(|(a, b)| ((*a).to_string(), (*b).to_string()))
            .collect();
        RedirectScheme {
            https_to_http,
            replacements,
            ..Self::default()
        }
    }
pub fn with_replacements < S : ToString > ( https_to_http : bool , replacements : & [ ( S , S ) ] ) -> Self { let replacements = replacements . iter ( ) . map ( | ( a , b ) | ( ( * a ) . to_string ( ) , ( * b ) . to_string ( ) ) ) . collect ( ) ; RedirectScheme { https_to_http , replacements , .. Self :: default ( ) } }
Creates a RedirectScheme middleware which also performs string replacement on the final url.
Creates a RedirectScheme middleware which also performs string replacement on the final url .
https_to_http
bool
replacements
&[(S, S)]
usage
```
extern crate actix_web_middleware_redirect_scheme.

use actix_web::{App, web, HttpResponse};
use actix_web_middleware_redirect_scheme::RedirectScheme.


` ` ` extern crate actix_web_middleware_redirect_scheme . use actix_web :: { App web HttpResponse } ; use actix_web_middleware_redirect_scheme :: RedirectScheme .