Struct actix_web::middleware::Compat
source[−]pub struct Compat<T> { /* private fields */ }
Expand description
Middleware for enabling any middleware to be used in Resource::wrap
,
and Condition
.
Examples
use actix_web::middleware::{Logger, Compat};
use actix_web::{App, web};
let logger = Logger::default();
// this would not compile because of incompatible body types
// let app = App::new()
// .service(web::scope("scoped").wrap(logger));
// by using this middleware we can use the logger on a scope
let app = App::new()
.service(web::scope("scoped").wrap(Compat::new(logger)));
Implementations
Trait Implementations
type Response = ServiceResponse<BoxBody>
type Response = ServiceResponse<BoxBody>
Responses produced by the service.
type Future = LocalBoxFuture<'static, Result<Self::Transform, Self::InitError>>
type Future = LocalBoxFuture<'static, Result<Self::Transform, Self::InitError>>
The future response value.
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl<T> RefUnwindSafe for Compat<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Compat<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more