Struct tor_hsclient::HsClientConnector
source · pub struct HsClientConnector<R: Runtime, D: MockableConnectorData = Data> { /* private fields */ }Expand description
An object that negotiates connections with onion services
This can be used by multiple requests on behalf of different clients,
with potentially different HS client authentication (KS_hsc_*)
and potentially different circuit isolation.
The principal entrypoint is
get_or_launch_connection().
This object is handle-like: it is fairly cheap to clone,
and contains Arcs internally.
Implementations§
source§impl<R: Runtime> HsClientConnector<R, Data>
impl<R: Runtime> HsClientConnector<R, Data>
sourcepub fn new(
runtime: R,
circpool: Arc<HsCircPool<R>>,
config: &impl HsClientConnectorConfig,
housekeeping_prompt: BoxStream<'static, ()>
) -> Result<Self, StartupError>
pub fn new( runtime: R, circpool: Arc<HsCircPool<R>>, config: &impl HsClientConnectorConfig, housekeeping_prompt: BoxStream<'static, ()> ) -> Result<Self, StartupError>
Create a new HsClientConnector
housekeeping_prompt should yield “occasionally”,
perhaps every few hours or maybe daily.
In Arti we arrange for this to happen when we have a new consensus.
Housekeeping events shouldn’t arrive while we’re dormant, since the housekeeping might involve processing that ought to be deferred.
sourcepub fn get_or_launch_connection<'r>(
&'r self,
netdir: &'r Arc<NetDir>,
hs_id: HsId,
secret_keys: HsClientSecretKeys,
isolation: StreamIsolation
) -> impl Future<Output = Result<Arc<ClientCirc>, ConnError>> + Send + Sync + 'r
pub fn get_or_launch_connection<'r>( &'r self, netdir: &'r Arc<NetDir>, hs_id: HsId, secret_keys: HsClientSecretKeys, isolation: StreamIsolation ) -> impl Future<Output = Result<Arc<ClientCirc>, ConnError>> + Send + Sync + 'r
Connect to a hidden service
Each HS connection request must provide the appropriate
client authentication keys to use -
or default if client auth is not required.
Trait Implementations§
Auto Trait Implementations§
impl<R, D = Data> !RefUnwindSafe for HsClientConnector<R, D>
impl<R, D> Send for HsClientConnector<R, D>
impl<R, D> Sync for HsClientConnector<R, D>
impl<R, D> Unpin for HsClientConnector<R, D>where R: Unpin, <D as MockableConnectorData>::MockGlobalState: Unpin,
impl<R, D = Data> !UnwindSafe for HsClientConnector<R, D>
Blanket Implementations§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.