mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
don't automatically wrap in RumaResponse
This allows us to use the `ruma_route` convenience function even when we need to add our own hacks into the responses, thus making us less reliant on Ruma.
This commit is contained in:
parent
87ac0e2a38
commit
230ebd3884
35 changed files with 438 additions and 405 deletions
|
|
@ -579,11 +579,13 @@ macro_rules! impl_ruma_handler {
|
|||
( $($ty:ident),* $(,)? ) => {
|
||||
#[axum::async_trait]
|
||||
#[allow(non_snake_case)]
|
||||
impl<Req, E, F, Fut, $($ty,)*> RumaHandler<($($ty,)* Ruma<Req>,)> for F
|
||||
impl<Req, Resp, E, F, Fut, $($ty,)*>
|
||||
RumaHandler<($($ty,)* Ruma<Req>,)> for F
|
||||
where
|
||||
Req: IncomingRequest + Send + 'static,
|
||||
Resp: IntoResponse,
|
||||
F: FnOnce($($ty,)* Ruma<Req>) -> Fut + Clone + Send + 'static,
|
||||
Fut: Future<Output = Result<Req::OutgoingResponse, E>>
|
||||
Fut: Future<Output = Result<Resp, E>>
|
||||
+ Send,
|
||||
E: IntoResponse,
|
||||
$( $ty: FromRequestParts<()> + Send + 'static, )*
|
||||
|
|
@ -600,7 +602,7 @@ macro_rules! impl_ruma_handler {
|
|||
on(
|
||||
method_filter,
|
||||
|$( $ty: $ty, )* req| async move {
|
||||
handler($($ty,)* req).await.map(RumaResponse)
|
||||
handler($($ty,)* req).await
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue