Ruma upgrade
This commit is contained in:
parent
17ad5f0595
commit
2808dd2000
45 changed files with 528 additions and 474 deletions
12
src/main.rs
12
src/main.rs
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue