mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +00:00
re-export gotham
This commit is contained in:
parent
a493071ff8
commit
63e6eb9b32
3 changed files with 10 additions and 9 deletions
|
@ -108,7 +108,12 @@ extern crate self as gotham_restful;
|
|||
#[macro_use] extern crate serde;
|
||||
|
||||
#[doc(no_inline)]
|
||||
pub use gotham::hyper::{header::HeaderName, StatusCode};
|
||||
pub use gotham;
|
||||
#[doc(no_inline)]
|
||||
pub use gotham::{
|
||||
hyper::{header::HeaderName, StatusCode},
|
||||
state::{FromState, State}
|
||||
};
|
||||
#[doc(no_inline)]
|
||||
pub use mime::Mime;
|
||||
|
||||
|
@ -119,10 +124,6 @@ pub use gotham_restful_derive::*;
|
|||
pub mod export
|
||||
{
|
||||
pub use futures_util::future::FutureExt;
|
||||
pub use gotham::{
|
||||
hyper::body::Bytes,
|
||||
state::{FromState, State}
|
||||
};
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
pub use gotham_middleware_diesel::Repo;
|
||||
|
|
|
@ -58,7 +58,7 @@ fn expand(tokens : TokenStream) -> Result<TokenStream2, Error>
|
|||
{
|
||||
type Err = String;
|
||||
|
||||
fn from_body(body : #krate::export::Bytes, _content_type : #krate::Mime) -> Result<Self, Self::Err>
|
||||
fn from_body(body : #krate::gotham::hyper::body::Bytes, _content_type : #krate::Mime) -> Result<Self, Self::Err>
|
||||
{
|
||||
let body : &[u8] = &body;
|
||||
Ok(#body)
|
||||
|
|
|
@ -367,7 +367,7 @@ fn expand(method : Method, attrs : TokenStream, item : TokenStream) -> Result<To
|
|||
let ty = arg.ty.quote_ty();
|
||||
quote!(#ident : #ty)
|
||||
}).collect();
|
||||
args_def.insert(0, quote!(mut #state_ident : #krate::export::State));
|
||||
args_def.insert(0, quote!(mut #state_ident : #krate::State));
|
||||
|
||||
// extract the arguments to pass over to the supplied method
|
||||
let args_pass : Vec<TokenStream2> = args.iter().map(|arg| match (&arg.ty, &arg.ident) {
|
||||
|
@ -447,10 +447,10 @@ fn expand(method : Method, attrs : TokenStream, item : TokenStream) -> Result<To
|
|||
{
|
||||
#(#generics)*
|
||||
|
||||
fn #method_ident(#(#args_def),*) -> std::pin::Pin<Box<dyn std::future::Future<Output = (#krate::export::State, #ret)> + Send>>
|
||||
fn #method_ident(#(#args_def),*) -> std::pin::Pin<Box<dyn std::future::Future<Output = (#krate::State, #ret)> + Send>>
|
||||
{
|
||||
#[allow(unused_imports)]
|
||||
use #krate::export::{FromState, FutureExt};
|
||||
use #krate::{export::FutureExt, FromState};
|
||||
|
||||
#state_block
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue