Struct arti_client::TorClientBuilder
source · [−]pub struct TorClientBuilder<R> { /* private fields */ }
Expand description
An object for constructing a TorClient
.
Returned by TorClient::builder()
.
Implementations
sourceimpl<R> TorClientBuilder<R>
impl<R> TorClientBuilder<R>
sourcepub fn config(self, config: TorClientConfig) -> Self
pub fn config(self, config: TorClientConfig) -> Self
Set the configuration for the TorClient
under construction.
If not called, then a compiled-in default configuration will be used.
sourcepub fn bootstrap_behavior(self, bootstrap_behavior: BootstrapBehavior) -> Self
pub fn bootstrap_behavior(self, bootstrap_behavior: BootstrapBehavior) -> Self
Set the bootstrap behavior for the TorClient
under construction.
If not called, then the default (BootstrapBehavior::OnDemand
) will
be used.
sourceimpl<R: Runtime> TorClientBuilder<R>
impl<R: Runtime> TorClientBuilder<R>
sourcepub fn create_unbootstrapped(self) -> Result<TorClient<R>>
pub fn create_unbootstrapped(self) -> Result<TorClient<R>>
Create a TorClient
from this builder, without automatically launching
the bootstrap process.
If you have left the default BootstrapBehavior
in place, the client
will bootstrap itself as soon any attempt is made to use it. You can
also bootstrap the client yourself by running its
bootstrap()
method.
If you have replaced the default behavior with BootstrapBehavior::Manual
,
any attempts to use the client will fail with an error of kind
ErrorKind::BootstrapRequired
,
until you have called TorClient::bootstrap
yourself.
This option is useful if you wish to have control over the bootstrap
process (for example, you might wish to avoid initiating network
connections until explicit user confirmation is given).
sourcepub async fn create_bootstrapped(self) -> Result<TorClient<R>>
pub async fn create_bootstrapped(self) -> Result<TorClient<R>>
Create a TorClient from this builder, and try to bootstrap it.
Trait Implementations
sourceimpl<R: Clone> Clone for TorClientBuilder<R>
impl<R: Clone> Clone for TorClientBuilder<R>
sourcefn clone(&self) -> TorClientBuilder<R>
fn clone(&self) -> TorClientBuilder<R>
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
Auto Trait Implementations
impl<R> RefUnwindSafe for TorClientBuilder<R> where
R: RefUnwindSafe,
impl<R> Send for TorClientBuilder<R> where
R: Send,
impl<R> Sync for TorClientBuilder<R> where
R: Sync,
impl<R> Unpin for TorClientBuilder<R> where
R: Unpin,
impl<R> UnwindSafe for TorClientBuilder<R> where
R: UnwindSafe,
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