Trait 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().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§