We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Error::is_connect
1 parent fd25129 commit 01f6498Copy full SHA for 01f6498
src/error.rs
@@ -97,13 +97,6 @@ pub(crate) enum User {
97
*/
98
99
impl Error {
100
- //TODO(error): should there be these kinds of inspection methods?
101
- //
102
- // - is_io()
103
- // - is_connect()
104
- // - is_closed()
105
- // - etc?
106
-
107
/// Returns true if this was an HTTP parse error.
108
pub fn is_parse(&self) -> bool {
109
match self.inner.kind {
@@ -139,6 +132,11 @@ impl Error {
139
132
self.inner.kind == Kind::Closed
140
133
}
141
134
135
+ /// Returns true if this was an error from `Connect`.
136
+ pub fn is_connect(&self) -> bool {
137
+ self.inner.kind == Kind::Connect
138
+ }
+
142
/// Returns the error's cause.
143
///
144
/// This is identical to `Error::cause` except that it provides extra
0 commit comments