Struct arti_client::config::TorClientConfigBuilder
source · [−]pub struct TorClientConfigBuilder { /* private fields */ }
Expand description
Builder object used to construct a TorClientConfig
.
Unlike other builder types in Arti, this builder works by exposing an
inner builder for each section in the TorClientConfig
.
Implementations
sourceimpl TorClientConfigBuilder
impl TorClientConfigBuilder
sourcepub fn build(&self) -> Result<TorClientConfig, ConfigBuildError>
pub fn build(&self) -> Result<TorClientConfig, ConfigBuildError>
Construct a TorClientConfig
from this builder.
sourcepub fn from_directories<P, Q>(state_dir: P, cache_dir: Q) -> Self where
P: AsRef<Path>,
Q: AsRef<Path>,
pub fn from_directories<P, Q>(state_dir: P, cache_dir: Q) -> Self where
P: AsRef<Path>,
Q: AsRef<Path>,
Returns a TorClientConfigBuilder
using the specified state and cache directories.
All other configuration options are set to their defaults.
sourcepub fn tor_network(&mut self) -> &mut NetworkConfigBuilder
pub fn tor_network(&mut self) -> &mut NetworkConfigBuilder
Return a mutable reference to a
NetworkConfigBuilder
to use in configuring the underlying Tor network.
Most programs shouldn’t need to alter this configuration: it’s only for cases when you need to use a nonstandard set of Tor directory authorities and fallback caches.
sourcepub fn storage(&mut self) -> &mut StorageConfigBuilder
pub fn storage(&mut self) -> &mut StorageConfigBuilder
Return a mutable reference to a StorageConfigBuilder
.
This section is used to configure the locations where Arti should store files on disk.
sourcepub fn download_schedule(&mut self) -> &mut DownloadScheduleConfigBuilder
pub fn download_schedule(&mut self) -> &mut DownloadScheduleConfigBuilder
Return a mutable reference to a
DownloadScheduleConfigBuilder
.
This section is used to override Arti’s schedule when attempting and retrying to download directory objects.
sourcepub fn override_net_params(&mut self) -> &mut HashMap<String, i32>
pub fn override_net_params(&mut self) -> &mut HashMap<String, i32>
Return a mutable reference to a HashMap
of network parameters
that should be used to override those specified in the consensus
directory.
This section should not usually be used for anything but testing: if you find yourself needing to configure an override here for production use, please consider opening a feature request for it instead.
For a complete list of Tor’s defined network parameters (not all of
which are yet supported by Arti), see
path-spec.txt
.
sourcepub fn path_rules(&mut self) -> &mut PathConfigBuilder
pub fn path_rules(&mut self) -> &mut PathConfigBuilder
Return a mutable reference to a PathConfigBuilder
.
This section is used to override Arti’s rules for selecting which relays should be used in a given circuit.
sourcepub fn preemptive_circuits(&mut self) -> &mut PreemptiveCircuitConfigBuilder
pub fn preemptive_circuits(&mut self) -> &mut PreemptiveCircuitConfigBuilder
Return a mutable reference to a PreemptiveCircuitConfigBuilder
.
This section overrides Arti’s rules for preemptive circuits.
sourcepub fn circuit_timing(&mut self) -> &mut CircuitTimingBuilder
pub fn circuit_timing(&mut self) -> &mut CircuitTimingBuilder
Return a mutable reference to a CircuitTimingBuilder
.
This section overrides Arti’s rules for deciding how long to use circuits, and when to give up on attempts to launch them.
sourcepub fn stream_timeouts(&mut self) -> &mut StreamTimeoutConfigBuilder
pub fn stream_timeouts(&mut self) -> &mut StreamTimeoutConfigBuilder
Return a mutable reference to a StreamTimeoutConfigBuilder
.
This section overrides Arti’s rules for deciding how long a stream request (that is, an attempt to connect or resolve) should wait for a response before deciding that the stream has timed out.
sourcepub fn address_filter(&mut self) -> &mut ClientAddrConfigBuilder
pub fn address_filter(&mut self) -> &mut ClientAddrConfigBuilder
Return a mutable reference to a ClientAddrConfigBuilder
.
This section controls which addresses Arti is willing to launch connections to over the Tor network. Any addresses rejected by this section cause stream attempts to fail before any traffic is sent over the network.
sourcepub fn system(&mut self) -> &mut SystemConfigBuilder
pub fn system(&mut self) -> &mut SystemConfigBuilder
Return a mutable reference to a SystemConfigBuilder
.
This section is used to configure the system resources used by Arti.
Trait Implementations
sourceimpl Clone for TorClientConfigBuilder
impl Clone for TorClientConfigBuilder
sourcefn clone(&self) -> TorClientConfigBuilder
fn clone(&self) -> TorClientConfigBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for TorClientConfigBuilder
impl Default for TorClientConfigBuilder
sourcefn default() -> TorClientConfigBuilder
fn default() -> TorClientConfigBuilder
Returns the “default value” for a type. Read more
sourceimpl From<TorClientConfig> for TorClientConfigBuilder
impl From<TorClientConfig> for TorClientConfigBuilder
sourcefn from(cfg: TorClientConfig) -> TorClientConfigBuilder
fn from(cfg: TorClientConfig) -> TorClientConfigBuilder
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for TorClientConfigBuilder
impl Send for TorClientConfigBuilder
impl Sync for TorClientConfigBuilder
impl Unpin for TorClientConfigBuilder
impl UnwindSafe for TorClientConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more