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_reset
1 parent dc7aa8e commit f6aa3beCopy full SHA for f6aa3be
src/error.rs
@@ -59,10 +59,7 @@ impl Error {
59
60
/// Returns true if the error is an io::Error
61
pub fn is_io(&self) -> bool {
62
- match self.kind {
63
- Kind::Io(_) => true,
64
- _ => false,
65
- }
+ matches!(self.kind, Kind::Io(..))
66
}
67
68
/// Returns the error if the error is an io::Error
@@ -92,6 +89,11 @@ impl Error {
92
89
matches!(self.kind, Kind::GoAway(..))
93
90
94
91
+ /// Returns true if the error is from a `RST_STREAM`.
+ pub fn is_reset(&self) -> bool {
+ matches!(self.kind, Kind::Reset(..))
95
+ }
96
+
97
/// Returns true if the error was received in a frame from the remote.
98
///
99
/// Such as from a received `RST_STREAM` or `GOAWAY` frame.
0 commit comments