@@ -16,7 +16,6 @@ use http::{
16
16
} ;
17
17
use http_body:: Body ;
18
18
use http_body_util:: BodyExt ;
19
- use hyper:: body:: Incoming ;
20
19
use volo:: { context:: Context , net:: Address } ;
21
20
22
21
use super :: IntoResponse ;
@@ -64,7 +63,7 @@ pub trait FromContext: Sized {
64
63
///
65
64
/// [`FromRequest`] will consume [`ServerRequest`], so it can only be used once in a handler. If
66
65
/// your extractor does not need to consume [`ServerRequest`], please use [`FromContext`] instead.
67
- pub trait FromRequest < B = Incoming , M = private:: ViaRequest > : Sized {
66
+ pub trait FromRequest < B = crate :: body :: Body , M = private:: ViaRequest > : Sized {
68
67
/// If the extractor fails, it will return this `Rejection` type.
69
68
///
70
69
/// The `Rejection` should implement [`IntoResponse`]. If extractor fails in handler, the
@@ -614,10 +613,9 @@ mod extract_tests {
614
613
use std:: convert:: Infallible ;
615
614
616
615
use http:: request:: Parts ;
617
- use hyper:: body:: Incoming ;
618
616
619
617
use super :: { FromContext , FromRequest } ;
620
- use crate :: { context:: ServerContext , server:: handler:: Handler } ;
618
+ use crate :: { body :: Body , context:: ServerContext , server:: handler:: Handler } ;
621
619
622
620
struct SomethingFromCx ;
623
621
@@ -638,7 +636,7 @@ mod extract_tests {
638
636
async fn from_request (
639
637
_: & mut ServerContext ,
640
638
_: Parts ,
641
- _: Incoming ,
639
+ _: Body ,
642
640
) -> Result < Self , Self :: Rejection > {
643
641
unimplemented ! ( )
644
642
}
@@ -648,7 +646,7 @@ mod extract_tests {
648
646
fn extractor ( ) {
649
647
fn assert_handler < H , T > ( _: H )
650
648
where
651
- H : Handler < T , Incoming , Infallible > ,
649
+ H : Handler < T , Body , Infallible > ,
652
650
{
653
651
}
654
652
0 commit comments