Trait tor_hsclient::state::MockableConnectorData

source ·
pub trait MockableConnectorData: Default + Debug + Send + Sync + 'static {
    type ClientCirc: Sync + Send + 'static;
    type MockGlobalState: Clone + Sync + Send + 'static;

    // Required methods
    fn connect<'life0, 'life1, 'async_trait, R>(
        connector: &'life0 HsClientConnector<R, Self>,
        netdir: Arc<NetDir>,
        config: Arc<Config>,
        hsid: HsId,
        data: &'life1 mut Self,
        secret_keys: HsClientSecretKeys
    ) -> Pin<Box<dyn Future<Output = Result<Arc<Self::ClientCirc>, ConnError>> + Send + 'async_trait>>
       where R: 'async_trait + Runtime,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn circuit_is_ok(circuit: &Self::ClientCirc) -> bool;
}
Expand description

Mocking for actual HS connection work, to let us test the Services state machine

Required Associated Types§

source

type ClientCirc: Sync + Send + 'static

Client circuit

source

type MockGlobalState: Clone + Sync + Send + 'static

Mock state

Required Methods§

source

fn connect<'life0, 'life1, 'async_trait, R>( connector: &'life0 HsClientConnector<R, Self>, netdir: Arc<NetDir>, config: Arc<Config>, hsid: HsId, data: &'life1 mut Self, secret_keys: HsClientSecretKeys ) -> Pin<Box<dyn Future<Output = Result<Arc<Self::ClientCirc>, ConnError>> + Send + 'async_trait>>
where R: 'async_trait + Runtime, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Connect

source

fn circuit_is_ok(circuit: &Self::ClientCirc) -> bool

Is circuit OK? Ie, not .is_closing().

Object Safety§

This trait is not object safe.

Implementors§