Merge pull request #321 from khuey/bb8-fixes

Fixes for bb8
This commit is contained in:
Steven Fackler 2018-03-01 19:44:57 -08:00 committed by GitHub
commit f76a292e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -1136,6 +1136,15 @@ impl Connection {
pub fn parameter(&self, param: &str) -> Option<&str> {
self.0.parameters.get(param).map(|s| &**s)
}
/// Returns whether or not the stream has been desynchronized due to an
/// error in the communication channel with the server.
///
/// If this has occurred, all further queries will immediately return an
/// error.
pub fn is_desynchronized(&self) -> bool {
self.0.desynchronized
}
}
/// A stream of asynchronous Postgres notifications.

View File

@ -32,7 +32,7 @@ impl TlsStream for Stream {
pub trait Handshake: 'static + Sync + Send {
/// Performs a TLS handshake, returning a wrapped stream.
fn handshake(
self: Box<Self>,
&self,
host: &str,
stream: Stream,
) -> Box<Future<Item = Box<TlsStream>, Error = Box<Error + Sync + Send>> + Send>;

View File

@ -40,7 +40,7 @@ impl From<SslConnector> for OpenSsl {
impl Handshake for OpenSsl {
fn handshake(
self: Box<Self>,
&self,
host: &str,
stream: Stream,
) -> Box<Future<Item = Box<TlsStream>, Error = Box<Error + Sync + Send>> + Send> {