Struct arti_client::TorClientBuilder
source · [−]pub struct TorClientBuilder<R: Runtime> { /* private fields */ }
Expand description
An object for constructing a TorClient
.
Returned by TorClient::builder()
.
Implementations
sourceimpl<R: Runtime> TorClientBuilder<R>
impl<R: Runtime> 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.
sourcepub fn disable_fs_permission_checks(self) -> Self
pub fn disable_fs_permission_checks(self) -> Self
Build an TorClient
that will not validate permissions and ownership
on the filesystem.
By default, these checks are configured with the storage.permissions
field of the configuration, and can be overridden with the
ARTI_FS_DISABLE_PERMISSION_CHECKS
environment variable.
sourcepub fn ignore_fs_permission_checks_env_var(self) -> Self
pub fn ignore_fs_permission_checks_env_var(self) -> Self
Build a TorClient
that will follow the permissions checks in
the storage.permissions
field of the configuration, regardless of how the
environment is set.
sourcepub fn obey_fs_permission_checks_env_var(self) -> Self
pub fn obey_fs_permission_checks_env_var(self) -> Self
Build a TorClient
that will follow the permissions checks in the
storage.permissions
field of the configuration, unless the
ARTI_FS_DISABLE_PERMISSION_CHECKS
environment variable is set.
This is the default.
sourcepub fn dirmgr_builder<B>(self, builder: Arc<dyn DirProviderBuilder<R>>) -> Self where
B: DirProviderBuilder<R> + 'static,
pub fn dirmgr_builder<B>(self, builder: Arc<dyn DirProviderBuilder<R>>) -> Self where
B: DirProviderBuilder<R> + 'static,
Override the default function used to construct the directory provider.
Only available when compiled with the experimental-api
feature: this
code is unstable.
sourcepub fn dirfilter<F>(self, filter: F) -> Self where
F: Into<Arc<dyn DirFilter + 'static>>,
pub fn dirfilter<F>(self, filter: F) -> Self where
F: Into<Arc<dyn DirFilter + 'static>>,
Install a DirFilter
to
Only available when compiled with the dirfilter
feature: this code
is unstable and not recommended for production use.
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 + Runtime> Clone for TorClientBuilder<R>
impl<R: Clone + Runtime> 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>
impl<R> !Send for TorClientBuilder<R>
impl<R> !Sync for TorClientBuilder<R>
impl<R> Unpin for TorClientBuilder<R> where
R: Unpin,
impl<R> !UnwindSafe for TorClientBuilder<R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. 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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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