@@ -50,6 +50,10 @@ pub(super) enum Kind {
5050 /// A pending item was dropped before ever being processed.
5151 Canceled ,
5252 /// Indicates a channel (client or body sender) is closed.
53+ #[ cfg( any(
54+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
55+ all( feature = "http2" , feature = "client" )
56+ ) ) ]
5357 ChannelClosed ,
5458 /// An `io::Error` that occurred while trying to read or write to a network stream.
5559 #[ cfg( all(
@@ -121,6 +125,10 @@ pub(super) enum User {
121125 ) ) ]
122126 Body ,
123127 /// The user aborted writing of the outgoing body.
128+ #[ cfg( any(
129+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
130+ feature = "ffi"
131+ ) ) ]
124132 BodyWriteAborted ,
125133 /// Error from future of user's Service.
126134 #[ cfg( any(
@@ -192,6 +200,16 @@ impl Error {
192200
193201 /// Returns true if a sender's channel is closed.
194202 pub fn is_closed ( & self ) -> bool {
203+ #[ cfg( not( any(
204+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
205+ all( feature = "http2" , feature = "client" )
206+ ) ) ) ]
207+ return false ;
208+
209+ #[ cfg( any(
210+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
211+ all( feature = "http2" , feature = "client" )
212+ ) ) ]
195213 matches ! ( self . inner. kind, Kind :: ChannelClosed )
196214 }
197215
@@ -202,6 +220,16 @@ impl Error {
202220
203221 /// Returns true if the body write was aborted.
204222 pub fn is_body_write_aborted ( & self ) -> bool {
223+ #[ cfg( not( any(
224+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
225+ feature = "ffi"
226+ ) ) ) ]
227+ return false ;
228+
229+ #[ cfg( any(
230+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
231+ feature = "ffi"
232+ ) ) ]
205233 matches ! ( self . inner. kind, Kind :: User ( User :: BodyWriteAborted ) )
206234 }
207235
@@ -280,6 +308,10 @@ impl Error {
280308 Error :: new ( Kind :: Io ) . with ( cause)
281309 }
282310
311+ #[ cfg( any(
312+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
313+ all( feature = "http2" , feature = "client" )
314+ ) ) ]
283315 pub ( super ) fn new_closed ( ) -> Error {
284316 Error :: new ( Kind :: ChannelClosed )
285317 }
@@ -300,6 +332,10 @@ impl Error {
300332 Error :: new ( Kind :: BodyWrite ) . with ( cause)
301333 }
302334
335+ #[ cfg( any(
336+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
337+ feature = "ffi"
338+ ) ) ]
303339 pub ( super ) fn new_body_write_aborted ( ) -> Error {
304340 Error :: new ( Kind :: User ( User :: BodyWriteAborted ) )
305341 }
@@ -407,6 +443,10 @@ impl Error {
407443 Kind :: IncompleteMessage => "connection closed before message completed" ,
408444 #[ cfg( all( any( feature = "client" , feature = "server" ) , feature = "http1" ) ) ]
409445 Kind :: UnexpectedMessage => "received unexpected message from connection" ,
446+ #[ cfg( any(
447+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
448+ all( feature = "http2" , feature = "client" )
449+ ) ) ]
410450 Kind :: ChannelClosed => "channel closed" ,
411451 Kind :: Canceled => "operation was canceled" ,
412452 #[ cfg( all( feature = "http1" , feature = "server" ) ) ]
@@ -436,6 +476,10 @@ impl Error {
436476 any( feature = "http1" , feature = "http2" )
437477 ) ) ]
438478 Kind :: User ( User :: Body ) => "error from user's Body stream" ,
479+ #[ cfg( any(
480+ all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ,
481+ feature = "ffi"
482+ ) ) ]
439483 Kind :: User ( User :: BodyWriteAborted ) => "user body write aborted" ,
440484 #[ cfg( any(
441485 all( any( feature = "client" , feature = "server" ) , feature = "http1" ) ,
0 commit comments