Loading Cargo.lock +1 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ version = "0.1.0" dependencies = [ "anyhow", "arti-client", "educe", "hyper", "pin-project", "thiserror", Loading crates/arti-hyper/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ experimental-api = [] [dependencies] anyhow = "1.0.23" arti-client = { path="../arti-client", version = "0.1.0"} educe = "0.4.6" hyper = { version = "0.14", features = ["http1", "client", "runtime"] } pin-project = "1" tokio = { package = "tokio", version = "1.7", features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros" ] } Loading crates/arti-hyper/src/lib.rs +3 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ use std::sync::Arc; use std::task::{Context, Poll}; use arti_client::{DataStream, IntoTorAddr, TorClient}; use educe::Educe; use hyper::client::connect::{Connected, Connection}; use hyper::http::uri::Scheme; use hyper::http::Uri; Loading Loading @@ -111,6 +112,8 @@ impl tor_error::HasKind for ConnectionError { /// This is a different Rust type to the TLS used *by* Tor to connect to relays etc. /// It might even be a different underlying TLS implementation /// (although that is usually not a particularly good idea). #[derive(Educe)] #[educe(Clone)] // #[derive(Debug)] infers an unwanted bound TC: Clone pub struct ArtiHttpConnector<R: Runtime, TC: TlsConn> { /// The client client: TorClient<R>, Loading @@ -120,13 +123,6 @@ pub struct ArtiHttpConnector<R: Runtime, TC: TlsConn> { } // #[derive(Clone)] infers a TC: Clone bound impl<R: Runtime, TC: TlsConn> Clone for ArtiHttpConnector<R, TC> { fn clone(&self) -> Self { let client = self.client.clone(); let tls_conn = self.tls_conn.clone(); Self { client, tls_conn } } } impl<R: Runtime, TC: TlsConn> ArtiHttpConnector<R, TC> { /// Make a new `ArtiHttpConnector` using an Arti `TorClient` object. Loading Loading
Cargo.lock +1 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ version = "0.1.0" dependencies = [ "anyhow", "arti-client", "educe", "hyper", "pin-project", "thiserror", Loading
crates/arti-hyper/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ experimental-api = [] [dependencies] anyhow = "1.0.23" arti-client = { path="../arti-client", version = "0.1.0"} educe = "0.4.6" hyper = { version = "0.14", features = ["http1", "client", "runtime"] } pin-project = "1" tokio = { package = "tokio", version = "1.7", features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros" ] } Loading
crates/arti-hyper/src/lib.rs +3 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ use std::sync::Arc; use std::task::{Context, Poll}; use arti_client::{DataStream, IntoTorAddr, TorClient}; use educe::Educe; use hyper::client::connect::{Connected, Connection}; use hyper::http::uri::Scheme; use hyper::http::Uri; Loading Loading @@ -111,6 +112,8 @@ impl tor_error::HasKind for ConnectionError { /// This is a different Rust type to the TLS used *by* Tor to connect to relays etc. /// It might even be a different underlying TLS implementation /// (although that is usually not a particularly good idea). #[derive(Educe)] #[educe(Clone)] // #[derive(Debug)] infers an unwanted bound TC: Clone pub struct ArtiHttpConnector<R: Runtime, TC: TlsConn> { /// The client client: TorClient<R>, Loading @@ -120,13 +123,6 @@ pub struct ArtiHttpConnector<R: Runtime, TC: TlsConn> { } // #[derive(Clone)] infers a TC: Clone bound impl<R: Runtime, TC: TlsConn> Clone for ArtiHttpConnector<R, TC> { fn clone(&self) -> Self { let client = self.client.clone(); let tls_conn = self.tls_conn.clone(); Self { client, tls_conn } } } impl<R: Runtime, TC: TlsConn> ArtiHttpConnector<R, TC> { /// Make a new `ArtiHttpConnector` using an Arti `TorClient` object. Loading