Loading crates/arti-client/src/client.rs +7 −14 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use tor_proto::circuit::ClientCirc; use tor_proto::stream::{DataStream, IpVersionPreference, StreamParameters}; use tor_rtcompat::{PreferredRuntime, Runtime, SleepProviderExt}; use educe::Educe; use futures::lock::Mutex as AsyncMutex; use futures::stream::StreamExt; use futures::task::SpawnExt; Loading Loading @@ -84,11 +85,13 @@ pub struct TorClient<R: Runtime> { } /// Preferences for whether a [`TorClient`] should bootstrap on its own or not. #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Educe)] #[educe(Default)] #[non_exhaustive] pub enum BootstrapBehavior { /// Bootstrap the client automatically when requests are made that require the client to be /// bootstrapped. #[educe(Default)] OnDemand, /// Make no attempts to automatically bootstrap. [`TorClient::bootstrap`] must be manually /// invoked in order for the [`TorClient`] to become useful. Loading @@ -99,12 +102,6 @@ pub enum BootstrapBehavior { Manual, } impl Default for BootstrapBehavior { fn default() -> Self { BootstrapBehavior::OnDemand } } /// Preferences for how to route a stream over the Tor network. #[derive(Debug, Clone, Default)] pub struct StreamPrefs { Loading @@ -117,9 +114,11 @@ pub struct StreamPrefs { } /// Record of how we are isolating connections #[derive(Debug, Clone)] #[derive(Debug, Clone, Educe)] #[educe(Default)] enum StreamIsolationPreference { /// No additional isolation #[educe(Default)] None, /// Id of the isolation group the connection should be part of Explicit(IsolationToken), Loading @@ -127,12 +126,6 @@ enum StreamIsolationPreference { EveryStream, } impl Default for StreamIsolationPreference { fn default() -> Self { StreamIsolationPreference::None } } impl StreamPrefs { /// Construct a new StreamPrefs. pub fn new() -> Self { Loading Loading
crates/arti-client/src/client.rs +7 −14 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use tor_proto::circuit::ClientCirc; use tor_proto::stream::{DataStream, IpVersionPreference, StreamParameters}; use tor_rtcompat::{PreferredRuntime, Runtime, SleepProviderExt}; use educe::Educe; use futures::lock::Mutex as AsyncMutex; use futures::stream::StreamExt; use futures::task::SpawnExt; Loading Loading @@ -84,11 +85,13 @@ pub struct TorClient<R: Runtime> { } /// Preferences for whether a [`TorClient`] should bootstrap on its own or not. #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Educe)] #[educe(Default)] #[non_exhaustive] pub enum BootstrapBehavior { /// Bootstrap the client automatically when requests are made that require the client to be /// bootstrapped. #[educe(Default)] OnDemand, /// Make no attempts to automatically bootstrap. [`TorClient::bootstrap`] must be manually /// invoked in order for the [`TorClient`] to become useful. Loading @@ -99,12 +102,6 @@ pub enum BootstrapBehavior { Manual, } impl Default for BootstrapBehavior { fn default() -> Self { BootstrapBehavior::OnDemand } } /// Preferences for how to route a stream over the Tor network. #[derive(Debug, Clone, Default)] pub struct StreamPrefs { Loading @@ -117,9 +114,11 @@ pub struct StreamPrefs { } /// Record of how we are isolating connections #[derive(Debug, Clone)] #[derive(Debug, Clone, Educe)] #[educe(Default)] enum StreamIsolationPreference { /// No additional isolation #[educe(Default)] None, /// Id of the isolation group the connection should be part of Explicit(IsolationToken), Loading @@ -127,12 +126,6 @@ enum StreamIsolationPreference { EveryStream, } impl Default for StreamIsolationPreference { fn default() -> Self { StreamIsolationPreference::None } } impl StreamPrefs { /// Construct a new StreamPrefs. pub fn new() -> Self { Loading