We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df0b7e2 commit 71cb6eeCopy full SHA for 71cb6ee
tokio-postgres/src/error/mod.rs
@@ -421,6 +421,11 @@ impl Error {
421
self.source().and_then(|e| e.downcast_ref::<DbError>())
422
}
423
424
+ /// Determines if the error was associated with closed connection.
425
+ pub fn is_closed(&self) -> bool {
426
+ self.0.kind == Kind::Closed
427
+ }
428
+
429
/// Returns the SQLSTATE error code associated with the error.
430
///
431
/// This is a convenience method that downcasts the cause to a `DbError` and returns its code.
0 commit comments