Ruma upgrade

This commit is contained in:
Timo Kösters 2022-04-06 21:31:29 +02:00
parent 17ad5f0595
commit 2808dd2000
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
45 changed files with 528 additions and 474 deletions

View file

@ -26,10 +26,7 @@ use http::{
Method, Uri,
};
use opentelemetry::trace::{FutureExt, Tracer};
use ruma::{
api::{client::error::ErrorKind, IncomingRequest},
Outgoing,
};
use ruma::api::{client::error::ErrorKind, IncomingRequest};
use tokio::{signal, sync::RwLock};
use tower::ServiceBuilder;
use tower_http::{
@ -408,16 +405,15 @@ macro_rules! impl_ruma_handler {
#[allow(non_snake_case)]
impl<Req, E, F, Fut, $($ty,)*> RumaHandler<($($ty,)* Ruma<Req>,)> for F
where
Req: Outgoing + 'static,
Req::Incoming: IncomingRequest + Send,
Req: IncomingRequest + Send + 'static,
F: FnOnce($($ty,)* Ruma<Req>) -> Fut + Clone + Send + 'static,
Fut: Future<Output = Result<<Req::Incoming as IncomingRequest>::OutgoingResponse, E>>
Fut: Future<Output = Result<Req::OutgoingResponse, E>>
+ Send,
E: IntoResponse,
$( $ty: FromRequest<axum::body::Body> + Send + 'static, )*
{
fn add_to_router(self, mut router: Router) -> Router {
let meta = Req::Incoming::METADATA;
let meta = Req::METADATA;
let method_filter = method_to_filter(meta.method);
for path in IntoIterator::into_iter([meta.unstable_path, meta.r0_path, meta.stable_path]).flatten() {