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.
Error::is_shutdown()
1 parent c88df78 commit b8affd8Copy full SHA for b8affd8
src/error.rs
@@ -241,6 +241,15 @@ impl Error {
241
matches!(self.inner.kind, Kind::User(User::BodyWriteAborted))
242
}
243
244
+ /// Returns true if the error was caused while calling `AsyncWrite::shutdown()`.
245
+ pub fn is_shutdown(&self) -> bool {
246
+ #[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
247
+ if matches!(self.inner.kind, Kind::Shutdown) {
248
+ return true;
249
+ }
250
+ false
251
252
+
253
/// Returns true if the error was caused by a timeout.
254
pub fn is_timeout(&self) -> bool {
255
#[cfg(all(feature = "http1", feature = "server"))]
0 commit comments