pub struct RpcConnBuilder {
prepend_path_reversed: Vec<SearchEntry>,
}
Expand description
Information about how to construct a connection to an Arti instance.
Fields§
§prepend_path_reversed: Vec<SearchEntry>
Path entries provided programmatically.
These are considered after entries in
the $ARTI_RPC_CONNECT_PATH_OVERRIDE
environment variable,
but before any other entries.
(See RPCConnBuilder::new
for details.)
These entries are stored in reverse order.
Implementations§
Source§impl RpcConnBuilder
impl RpcConnBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new RpcConnBuilder
to try connecting to an Arti instance.
By default, we search:
- Any connect points listed in the environment variable
$ARTI_RPC_CONNECT_PATH_OVERRIDE
- Any connect points passed to
RpcConnBuilder::prepend_*
(Since these variables are prepended, the ones that are prepended last will be considered first.) - Any connect points listed in the environment variable
$ARTI_RPC_CONNECT_PATH
- Any connect files in
${ARTI_LOCAL_DATA}/rpc/connect.d
- Any connect files in
/etc/arti-rpc/connect.d
(unix only) - [
tor_rpc_connect::USER_DEFAULT_CONNECT_POINT
] - [
tor_rpc_connect::SYSTEM_DEFAULT_CONNECT_POINT
] if present
Sourcepub fn prepend_literal_entry(&mut self, s: String)
pub fn prepend_literal_entry(&mut self, s: String)
Prepend a single literal connect point to the search path in this RpcConnBuilder.
This entry will be considered before any entries in
the $ARTI_RPC_CONNECT_PATH
environment variable
but after any entry in
the $ARTI_RPC_CONNECT_PATH_OVERRIDE
environment variable.
This entry must be a literal connect point, expressed as a TOML table.
Sourcepub fn prepend_path(&mut self, p: String)
pub fn prepend_path(&mut self, p: String)
Prepend a single path entry to the search path in this RpcConnBuilder.
This entry will be considered before any entries in
the $ARTI_RPC_CONNECT_PATH
environment variable,
but after any entry in
the $ARTI_RPC_CONNECT_PATH_OVERRIDE
environment variable.
This entry must be a path to a file or directory.
It may contain variables to expand;
they will be expanded according to the rules of [CfgPath
],
using the variables of [tor_config_path::arti_client_base_resolver
].
Sourcepub fn prepend_literal_path(&mut self, p: PathBuf)
pub fn prepend_literal_path(&mut self, p: PathBuf)
Prepend a single literal path entry to the search path in this RpcConnBuilder.
This entry will be considered before any entries in
the $ARTI_RPC_CONNECT_PATH
environment variable,
but after any entry in
the $ARTI_RPC_CONNECT_PATH_OVERRIDE
environment variable.
Variables in this entry will not be expanded.
Sourcefn prepend_internal(&mut self, location: SearchLocation)
fn prepend_internal(&mut self, location: SearchLocation)
Prepend the application-provided SearchLocation
to the path.
Sourcefn default_path_entries() -> Vec<SearchEntry>
fn default_path_entries() -> Vec<SearchEntry>
Return the list of default path entries that we search after all user-provided entries.
Sourcefn all_entries(&self) -> Result<Vec<SearchEntry>, ConnectError>
fn all_entries(&self) -> Result<Vec<SearchEntry>, ConnectError>
Return a vector of every PathEntry that we should try to connect to.
Sourcepub fn connect(&self) -> Result<RpcConn, ConnectFailure>
pub fn connect(&self) -> Result<RpcConn, ConnectFailure>
Try to connect to an Arti process as specified by this Builder.
Trait Implementations§
Source§impl Clone for RpcConnBuilder
impl Clone for RpcConnBuilder
Source§fn clone(&self) -> RpcConnBuilder
fn clone(&self) -> RpcConnBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RpcConnBuilder
impl Debug for RpcConnBuilder
Source§impl Default for RpcConnBuilder
impl Default for RpcConnBuilder
Source§fn default() -> RpcConnBuilder
fn default() -> RpcConnBuilder
Auto Trait Implementations§
impl Freeze for RpcConnBuilder
impl RefUnwindSafe for RpcConnBuilder
impl Send for RpcConnBuilder
impl Sync for RpcConnBuilder
impl Unpin for RpcConnBuilder
impl UnwindSafe for RpcConnBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more