@ealmloff changes to reexport actix/axum

This commit is contained in:
Greg Johnston 2024-01-03 07:31:03 -05:00
parent 9c258219dd
commit dd368a845c
2 changed files with 10 additions and 5 deletions

View File

@ -7,9 +7,14 @@ pub mod redirect;
pub mod request;
pub mod response;
#[cfg(feature = "actix")]
#[doc(hidden)]
pub use ::actix_web as actix_export;
#[cfg(feature = "axum")]
#[doc(hidden)]
pub use ::axum as axum_export;
use client::Client;
use codec::{Encoding, FromReq, FromRes, IntoReq, IntoRes};
// reexports for the sake of the macro
#[doc(hidden)]
pub use const_format;
use dashmap::DashMap;

View File

@ -319,11 +319,11 @@ pub fn server_macro_impl(
}
} else if cfg!(feature = "axum") {
quote! {
::axum::http::Request<::axum::body::Body>
#server_fn_path::axum_export::http::Request<#server_fn_path::axum_export::body::Body>
}
} else if cfg!(feature = "actix") {
quote! {
::actix_web::HttpRequest
#server_fn_path::actix_export::HttpRequest
}
} else {
return Err(syn::Error::new(
@ -338,11 +338,11 @@ pub fn server_macro_impl(
}
} else if cfg!(feature = "axum") {
quote! {
::axum::http::Response<::axum::body::Body>
#server_fn_path::axum_export::http::Response<#server_fn_path::axum_export::body::Body>
}
} else if cfg!(feature = "actix") {
quote! {
::actix_web::HttpResponse
#server_fn_path::actix_export::HttpResponse
}
} else {
return Err(syn::Error::new(