We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c449528 commit 2e44beaCopy full SHA for 2e44bea
src/error.rs
@@ -238,6 +238,15 @@ 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
+ if matches!(self.inner.kind, Kind::Shutdown) {
245
+ return true;
246
+ }
247
+ false
248
249
+
250
/// Returns true if the error was caused by a timeout.
251
pub fn is_timeout(&self) -> bool {
252
#[cfg(all(feature = "http1", feature = "server"))]
0 commit comments