mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-23 02:43:16 +01:00
Update actix_web to 4.0 (#7)
This commit is contained in:
parent
cae596811d
commit
a66fecf020
@ -16,7 +16,7 @@ keywords = ["http", "actix-web", "tracing", "logging"]
|
|||||||
categories = ["asynchronous", "web-programming"]
|
categories = ["asynchronous", "web-programming"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "3"
|
actix-web = "4.0.0-beta.1"
|
||||||
tracing = "0.1.19"
|
tracing = "0.1.19"
|
||||||
tracing-futures = "0.2.4"
|
tracing-futures = "0.2.4"
|
||||||
futures = "0.3.5"
|
futures = "0.3.5"
|
||||||
|
10
src/lib.rs
10
src/lib.rs
@ -89,13 +89,12 @@ use uuid::Uuid;
|
|||||||
/// [`tracing`]: https://docs.rs/tracing
|
/// [`tracing`]: https://docs.rs/tracing
|
||||||
pub struct TracingLogger;
|
pub struct TracingLogger;
|
||||||
|
|
||||||
impl<S, B> Transform<S> for TracingLogger
|
impl<S, B> Transform<S, ServiceRequest> for TracingLogger
|
||||||
where
|
where
|
||||||
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
||||||
S::Future: 'static,
|
S::Future: 'static,
|
||||||
B: 'static,
|
B: 'static,
|
||||||
{
|
{
|
||||||
type Request = ServiceRequest;
|
|
||||||
type Response = ServiceResponse<B>;
|
type Response = ServiceResponse<B>;
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
type Transform = TracingLoggerMiddleware<S>;
|
type Transform = TracingLoggerMiddleware<S>;
|
||||||
@ -158,13 +157,12 @@ impl std::fmt::Display for RequestId {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S, B> Service for TracingLoggerMiddleware<S>
|
impl<S, B> Service<ServiceRequest> for TracingLoggerMiddleware<S>
|
||||||
where
|
where
|
||||||
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
||||||
S::Future: 'static,
|
S::Future: 'static,
|
||||||
B: 'static,
|
B: 'static,
|
||||||
{
|
{
|
||||||
type Request = ServiceRequest;
|
|
||||||
type Response = ServiceResponse<B>;
|
type Response = ServiceResponse<B>;
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
|
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user