@@ -25,6 +25,7 @@ pub struct TimeoutLayer {
2525
2626impl TimeoutLayer {
2727 /// Create a new [`TimeoutLayer`].
28+ #[ inline( always) ]
2829 pub const fn new ( options : TimeoutOptions ) -> Self {
2930 TimeoutLayer {
3031 timeout : RequestConfig :: new ( Some ( options) ) ,
@@ -35,6 +36,7 @@ impl TimeoutLayer {
3536impl < S > Layer < S > for TimeoutLayer {
3637 type Service = Timeout < S > ;
3738
39+ #[ inline( always) ]
3840 fn layer ( & self , service : S ) -> Self :: Service {
3941 Timeout {
4042 inner : service,
6466 self . inner . poll_ready ( cx)
6567 }
6668
69+ #[ inline( always) ]
6770 fn call ( & mut self , req : Request < ReqBody > ) -> Self :: Future {
6871 let ( total_timeout, read_timeout) = resolve_timeout_config ( & self . timeout , req. extensions ( ) ) ;
6972 ResponseFuture {
@@ -83,6 +86,7 @@ pub struct ResponseBodyTimeoutLayer {
8386
8487impl ResponseBodyTimeoutLayer {
8588 /// Creates a new [`ResponseBodyTimeoutLayer`].
89+ #[ inline( always) ]
8690 pub const fn new ( options : TimeoutOptions ) -> Self {
8791 Self {
8892 timeout : RequestConfig :: new ( Some ( options) ) ,
@@ -93,6 +97,7 @@ impl ResponseBodyTimeoutLayer {
9397impl < S > Layer < S > for ResponseBodyTimeoutLayer {
9498 type Service = ResponseBodyTimeout < S > ;
9599
100+ #[ inline( always) ]
96101 fn layer ( & self , inner : S ) -> Self :: Service {
97102 ResponseBodyTimeout {
98103 inner,
@@ -122,6 +127,7 @@ where
122127 self . inner . poll_ready ( cx)
123128 }
124129
130+ #[ inline( always) ]
125131 fn call ( & mut self , req : Request < ReqBody > ) -> Self :: Future {
126132 let ( total_timeout, read_timeout) = resolve_timeout_config ( & self . timeout , req. extensions ( ) ) ;
127133 ResponseBodyTimeoutFuture {
0 commit comments