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§
sourcetype ClientCirc: Sync + Send + 'static
type ClientCirc: Sync + Send + 'static
Client circuit
sourcetype MockGlobalState: Clone + Sync + Send + 'static
type MockGlobalState: Clone + Sync + Send + 'static
Mock state
Required Methods§
sourcefn 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 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
sourcefn circuit_is_ok(circuit: &Self::ClientCirc) -> bool
fn circuit_is_ok(circuit: &Self::ClientCirc) -> bool
Is circuit OK? Ie, not .is_closing()
.
Object Safety§
This trait is not object safe.