diff --git a/edgedb-tokio/src/builder.rs b/edgedb-tokio/src/builder.rs index 3c4ed3b4..b5489657 100644 --- a/edgedb-tokio/src/builder.rs +++ b/edgedb-tokio/src/builder.rs @@ -7,7 +7,7 @@ use std::io; use std::path::{Path, PathBuf}; use std::str::{self, FromStr}; use std::sync::Arc; -use std::time::{Duration}; +use std::time::Duration; use base64::Engine; use rustls::client::ServerCertVerifier; @@ -18,9 +18,8 @@ use tokio::fs; use edgedb_protocol::model; use crate::credentials::{Credentials, TlsSecurity}; -use crate::errors::{ClientError}; use crate::errors::{ClientNoCredentialsError, NoCloudConfigFound}; -use crate::errors::{Error, ErrorKind, ResultExt}; +use crate::errors::{ClientError, Error, ErrorKind, ResultExt}; use crate::errors::{InterfaceError, InvalidArgumentError}; use crate::tls; @@ -93,6 +92,12 @@ pub struct Builder { #[derive(Clone)] pub struct Config(pub(crate) Arc); +impl Config { + /// The duration for which the client will attempt to establish a connection. + pub fn wait_until_available(&self) -> Duration { + self.0.wait + } +} #[derive(Clone)] pub(crate) struct ConfigInner { diff --git a/edgedb-tokio/src/credentials.rs b/edgedb-tokio/src/credentials.rs index e5615c16..be136765 100644 --- a/edgedb-tokio/src/credentials.rs +++ b/edgedb-tokio/src/credentials.rs @@ -168,8 +168,8 @@ impl<'de> Deserialize<'de> for Credentials { .unwrap_or(false) { Err(serde::de::Error::custom(format!( - "detected conflicting settings: \ - tls_security={} but tls_verify_hostname={}", + "detected conflicting settings. \ + \ntls_security =\n{}\nbut tls_verify_hostname =\n{}", serde_json::to_string(&creds.tls_security) .map_err(serde::de::Error::custom)?, serde_json::to_string(&creds.tls_verify_hostname) @@ -180,8 +180,8 @@ impl<'de> Deserialize<'de> for Credentials { creds.tls_ca != creds.tls_cert_data { Err(serde::de::Error::custom(format!( - "detected conflicting settings: \ - tls_ca={:?} but tls_cert_data={:?}", + "detected conflicting settings. \ + \ntls_ca =\n{:#?}\nbut tls_cert_data =\n{:#?}", creds.tls_ca, creds.tls_cert_data, )))