@@ -98,6 +98,12 @@ pub use super::tcp::{AddrIncoming, AddrStream};
98
98
#[ derive( Clone , Debug ) ]
99
99
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
100
100
#[ cfg_attr( docsrs, doc( cfg( any( feature = "http1" , feature = "http2" ) ) ) ) ]
101
+ #[ cfg_attr(
102
+ feature = "deprecated" ,
103
+ deprecated(
104
+ note = "This struct will be replaced with `server::conn::http1::Builder` and `server::conn::http2::Builder` in 1.0, enable the \" backports\" feature to use them now."
105
+ )
106
+ ) ]
101
107
pub struct Http < E = Exec > {
102
108
pub ( crate ) exec : E ,
103
109
h1_half_close : bool ,
@@ -213,6 +219,12 @@ impl<E> Unpin for Fallback<E> {}
213
219
#[ derive( Debug ) ]
214
220
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
215
221
#[ cfg_attr( docsrs, doc( cfg( any( feature = "http1" , feature = "http2" ) ) ) ) ]
222
+ #[ cfg_attr(
223
+ feature = "deprecated" ,
224
+ deprecated(
225
+ note = "This struct will be replaced with `server::conn::http1::Parts` in 1.0, enable the \" backports\" feature to use them now."
226
+ )
227
+ ) ]
216
228
pub struct Parts < T , S > {
217
229
/// The original IO object used in the handshake.
218
230
pub io : T ,
@@ -232,6 +244,7 @@ pub struct Parts<T, S> {
232
244
233
245
// ===== impl Http =====
234
246
247
+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
235
248
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
236
249
impl Http {
237
250
/// Creates a new instance of the HTTP protocol, ready to spawn a server or
@@ -255,6 +268,7 @@ impl Http {
255
268
}
256
269
}
257
270
271
+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
258
272
#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
259
273
impl < E > Http < E > {
260
274
/// Sets whether HTTP1 is required.
@@ -738,6 +752,7 @@ where
738
752
///
739
753
/// # Panics
740
754
/// This method will panic if this connection is using an h2 protocol.
755
+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
741
756
pub fn into_parts ( self ) -> Parts < I , S > {
742
757
self . try_into_parts ( )
743
758
. unwrap_or_else ( || panic ! ( "h2 cannot into_inner" ) )
@@ -746,6 +761,7 @@ where
746
761
/// Return the inner IO object, and additional information, if available.
747
762
///
748
763
/// This method will return a `None` if this connection is using an h2 protocol.
764
+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
749
765
pub fn try_into_parts ( self ) -> Option < Parts < I , S > > {
750
766
match self . conn . unwrap ( ) {
751
767
#[ cfg( feature = "http1" ) ]
@@ -772,8 +788,7 @@ where
772
788
/// upgrade. Once the upgrade is completed, the connection would be "done",
773
789
/// but it is not desired to actually shutdown the IO object. Instead you
774
790
/// would take it back using `into_parts`.
775
- pub fn poll_without_shutdown ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < crate :: Result < ( ) > >
776
- {
791
+ pub fn poll_without_shutdown ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
777
792
loop {
778
793
match * self . conn . as_mut ( ) . unwrap ( ) {
779
794
#[ cfg( feature = "http1" ) ]
@@ -809,8 +824,8 @@ where
809
824
/// # Error
810
825
///
811
826
/// This errors if the underlying connection protocol is not HTTP/1.
812
- pub fn without_shutdown ( self ) -> impl Future < Output = crate :: Result < Parts < I , S > > >
813
- {
827
+ # [ cfg_attr ( feature = "deprecated" , allow ( deprecated ) ) ]
828
+ pub fn without_shutdown ( self ) -> impl Future < Output = crate :: Result < Parts < I , S > > > {
814
829
let mut conn = Some ( self ) ;
815
830
futures_util:: future:: poll_fn ( move |cx| {
816
831
ready ! ( conn. as_mut( ) . unwrap( ) . poll_without_shutdown( cx) ) ?;
0 commit comments