We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c449528 commit 6cc3638Copy full SHA for 6cc3638
src/error.rs
@@ -238,6 +238,14 @@ impl Error {
238
matches!(self.inner.kind, Kind::User(User::BodyWriteAborted))
239
}
240
241
+ /// Returns true if the error was caused while calling `AsyncWrite::shutdown()`.
242
+ pub fn is_shutdown(&self) -> bool {
243
+ #[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
244
+ matches!(self.inner.kind, Kind::Shutdown);
245
+ #[cfg(not(all(feature = "http1", any(feature = "client", feature = "server"))))]
246
+ false
247
+ }
248
+
249
/// Returns true if the error was caused by a timeout.
250
pub fn is_timeout(&self) -> bool {
251
#[cfg(all(feature = "http1", feature = "server"))]
0 commit comments