Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b171da3

Browse files
committed
Add an is_desynchronized on tokio_postgres::Connection.
1 parent 64286d0 commit b171da3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tokio-postgres/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,15 @@ impl Connection {
11361136
pub fn parameter(&self, param: &str) -> Option<&str> {
11371137
self.0.parameters.get(param).map(|s| &**s)
11381138
}
1139+
1140+
/// Returns whether or not the stream has been desynchronized due to an
1141+
/// error in the communication channel with the server.
1142+
///
1143+
/// If this has occurred, all further queries will immediately return an
1144+
/// error.
1145+
pub fn is_desynchronized(&self) -> bool {
1146+
self.0.desynchronized
1147+
}
11391148
}
11401149

11411150
/// A stream of asynchronous Postgres notifications.

0 commit comments

Comments
 (0)