allow Client with openssl+proxy

This commit is contained in:
Riccardo Casatta 2020-07-31 16:58:43 +02:00
parent 335fd49eb5
commit d5e4bfe3e7
No known key found for this signature in database
GPG Key ID: FD986A969E450397
3 changed files with 8 additions and 5 deletions

View File

@ -30,7 +30,7 @@ webpki = { version = "0.21.0", optional = true }
webpki-roots = { version = "^0.19", optional = true }
[features]
default = ["socks", "webpki", "webpki-roots", "rustls"]
default = ["proxy", "use-rustls"]
minimal = []
debug-calls = []
proxy = ["socks"]

View File

@ -11,8 +11,7 @@ use types::*;
/// [`RawClient`](client/struct.RawClient.html) and provides a more user-friendly
/// constructor that can choose the right backend based on the url prefix.
///
/// **This is only available with the `default` features.**
#[cfg(feature = "default")]
/// **This is available only with the `default` features, or if `proxy` and one ssl implementation are enabled**
pub enum Client {
#[doc(hidden)]
TCP(RawClient<ElectrumPlaintextStream>),
@ -32,7 +31,6 @@ macro_rules! impl_inner_call {
}
}
#[cfg(feature = "default")]
impl Client {
/// Generic constructor that supports multiple backends and, optionally, a socks5 proxy.
///
@ -70,7 +68,6 @@ impl Client {
}
}
#[cfg(feature = "default")]
impl ElectrumApi for Client {
#[inline]
fn batch_call(&self, batch: Batch) -> Result<Vec<serde_json::Value>, Error> {

View File

@ -40,7 +40,13 @@ extern crate webpki_roots;
mod api;
mod batch;
#[cfg(any(
all(feature = "proxy", feature = "use-openssl"),
all(feature = "proxy", feature = "use-rustls")
))]
pub mod client;
pub mod raw_client;
mod stream;
mod types;