Settings
Help

MockableConnectorData

Trait MockableConnectorData 

Source
pub trait MockableConnectorData:
    Default
    + Debug
    + Send
    + Sync
    + 'static {
    type DataTunnel: 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<Self::DataTunnel, ConnError>> + Send + 'async_trait>>
       where R: 'async_trait + Runtime,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn tunnel_is_ok(tunnel: &Self::DataTunnel) -> bool;
}
Expand description

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

Required Associated Types§

Source

type DataTunnel: 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<Self::DataTunnel, ConnError>> + Send + 'async_trait>>
where R: 'async_trait + Runtime, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Connect

Source

fn tunnel_is_ok(tunnel: &Self::DataTunnel) -> 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§

Source§

impl MockableConnectorData for Data

Source§

type DataTunnel = ClientOnionServiceDataTunnel

Source§

type MockGlobalState = ()