chore: update to axum 0.5 (#953)
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ tokio = {version = "1.0.1", features = ["net"], optional = true}
|
|||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
tower = {version = "0.4.7", features = ["balance", "buffer", "discover", "limit", "load", "make", "timeout", "util"], optional = true}
|
tower = {version = "0.4.7", features = ["balance", "buffer", "discover", "limit", "load", "make", "timeout", "util"], optional = true}
|
||||||
tracing-futures = {version = "0.2", optional = true}
|
tracing-futures = {version = "0.2", optional = true}
|
||||||
axum = {version = "0.4", default_features = false, optional = true}
|
axum = {version = "0.5", default_features = false, optional = true}
|
||||||
|
|
||||||
# rustls
|
# rustls
|
||||||
rustls-pemfile = { version = "0.3", optional = true }
|
rustls-pemfile = { version = "0.3", optional = true }
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use hyper::Body;
|
|||||||
use pin_project::pin_project;
|
use pin_project::pin_project;
|
||||||
use std::{
|
use std::{
|
||||||
convert::Infallible,
|
convert::Infallible,
|
||||||
|
fmt,
|
||||||
future::Future,
|
future::Future,
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
task::{Context, Poll},
|
task::{Context, Poll},
|
||||||
@@ -54,8 +55,7 @@ impl Routes {
|
|||||||
|
|
||||||
async fn unimplemented() -> impl axum::response::IntoResponse {
|
async fn unimplemented() -> impl axum::response::IntoResponse {
|
||||||
let status = http::StatusCode::OK;
|
let status = http::StatusCode::OK;
|
||||||
let headers =
|
let headers = [("grpc-status", "12"), ("content-type", "application/grpc")];
|
||||||
axum::response::Headers([("grpc-status", "12"), ("content-type", "application/grpc")]);
|
|
||||||
(status, headers)
|
(status, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,8 +75,13 @@ impl Service<Request<Body>> for Routes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[pin_project]
|
#[pin_project]
|
||||||
#[derive(Debug)]
|
pub struct RoutesFuture(#[pin] axum::routing::future::RouteFuture<Body, Infallible>);
|
||||||
pub struct RoutesFuture(#[pin] axum::routing::future::RouterFuture<Body>);
|
|
||||||
|
impl fmt::Debug for RoutesFuture {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_tuple("RoutesFuture").finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Future for RoutesFuture {
|
impl Future for RoutesFuture {
|
||||||
type Output = Result<Response<BoxBody>, crate::Error>;
|
type Output = Result<Response<BoxBody>, crate::Error>;
|
||||||
|
|||||||
Reference in New Issue
Block a user