@@ -98,6 +98,12 @@ pub use super::tcp::{AddrIncoming, AddrStream};
9898#[ derive( Clone , Debug ) ]
9999#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
100100#[ 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+ ) ]
101107pub struct Http < E = Exec > {
102108 pub ( crate ) exec : E ,
103109 h1_half_close : bool ,
@@ -213,6 +219,12 @@ impl<E> Unpin for Fallback<E> {}
213219#[ derive( Debug ) ]
214220#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
215221#[ 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+ ) ]
216228pub struct Parts < T , S > {
217229 /// The original IO object used in the handshake.
218230 pub io : T ,
@@ -232,6 +244,7 @@ pub struct Parts<T, S> {
232244
233245// ===== impl Http =====
234246
247+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
235248#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
236249impl Http {
237250 /// Creates a new instance of the HTTP protocol, ready to spawn a server or
@@ -255,6 +268,7 @@ impl Http {
255268 }
256269}
257270
271+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
258272#[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
259273impl < E > Http < E > {
260274 /// Sets whether HTTP1 is required.
@@ -738,6 +752,7 @@ where
738752 ///
739753 /// # Panics
740754 /// This method will panic if this connection is using an h2 protocol.
755+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
741756 pub fn into_parts ( self ) -> Parts < I , S > {
742757 self . try_into_parts ( )
743758 . unwrap_or_else ( || panic ! ( "h2 cannot into_inner" ) )
@@ -746,6 +761,7 @@ where
746761 /// Return the inner IO object, and additional information, if available.
747762 ///
748763 /// This method will return a `None` if this connection is using an h2 protocol.
764+ #[ cfg_attr( feature = "deprecated" , allow( deprecated) ) ]
749765 pub fn try_into_parts ( self ) -> Option < Parts < I , S > > {
750766 match self . conn . unwrap ( ) {
751767 #[ cfg( feature = "http1" ) ]
@@ -772,8 +788,7 @@ where
772788 /// upgrade. Once the upgrade is completed, the connection would be "done",
773789 /// but it is not desired to actually shutdown the IO object. Instead you
774790 /// 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 < ( ) > > {
777792 loop {
778793 match * self . conn . as_mut ( ) . unwrap ( ) {
779794 #[ cfg( feature = "http1" ) ]
@@ -809,8 +824,8 @@ where
809824 /// # Error
810825 ///
811826 /// 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 > > > {
814829 let mut conn = Some ( self ) ;
815830 futures_util:: future:: poll_fn ( move |cx| {
816831 ready ! ( conn. as_mut( ) . unwrap( ) . poll_without_shutdown( cx) ) ?;
0 commit comments