Skip to content

Commit f76a292

Browse files
authored
Merge pull request sfackler#321 from khuey/bb8-fixes
Fixes for bb8
2 parents 17fcbe3 + b9b3f47 commit f76a292

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

tokio-postgres/src/lib.rs

+9
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.

tokio-postgres/src/tls/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl TlsStream for Stream {
3232
pub trait Handshake: 'static + Sync + Send {
3333
/// Performs a TLS handshake, returning a wrapped stream.
3434
fn handshake(
35-
self: Box<Self>,
35+
&self,
3636
host: &str,
3737
stream: Stream,
3838
) -> Box<Future<Item = Box<TlsStream>, Error = Box<Error + Sync + Send>> + Send>;

tokio-postgres/src/tls/openssl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl From<SslConnector> for OpenSsl {
4040

4141
impl Handshake for OpenSsl {
4242
fn handshake(
43-
self: Box<Self>,
43+
&self,
4444
host: &str,
4545
stream: Stream,
4646
) -> Box<Future<Item = Box<TlsStream>, Error = Box<Error + Sync + Send>> + Send> {

0 commit comments

Comments
 (0)