Skip to main content

MockableCircPool

Trait MockableCircPool 

Source
trait MockableCircPool<R> {
    type DirTunnel: MockableClientDir;
    type DataTunnel: MockableClientData;
    type IntroTunnel: MockableClientIntro;

    // Required methods
    fn m_get_or_launch_dir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        netdir: &'life1 NetDir,
        target: impl 'async_trait + CircTarget + Send + Sync,
    ) -> Pin<Box<dyn Future<Output = Result<Self::DirTunnel>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn m_get_or_launch_intro<'life0, 'life1, 'async_trait>(
        &'life0 self,
        netdir: &'life1 NetDir,
        target: impl 'async_trait + CircTarget + Send + Sync,
    ) -> Pin<Box<dyn Future<Output = Result<Self::IntroTunnel>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn m_get_or_launch_client_rend<'a, 'life0, 'async_trait>(
        &'life0 self,
        netdir: &'a NetDir,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::DataTunnel, Relay<'a>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn m_estimate_timeout(&self, action: &TimeoutsAction) -> Duration;
}
Expand description

Mock for HsCircPool

Methods start with m_ to avoid the following problem: ClientCirc::start_conversation (say) means to use the inherent method if one exists, but will use a trait method if there isn’t an inherent method.

So if the inherent method is renamed, the call in the impl here turns into an always-recursive call. This is not detected by the compiler due to the situation being complicated by futures, #[async_trait] etc. https://github.com/rust-lang/rust/issues/111177

Required Associated Types§

Required Methods§

Source

fn m_get_or_launch_dir<'life0, 'life1, 'async_trait>( &'life0 self, netdir: &'life1 NetDir, target: impl 'async_trait + CircTarget + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Self::DirTunnel>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn m_get_or_launch_intro<'life0, 'life1, 'async_trait>( &'life0 self, netdir: &'life1 NetDir, target: impl 'async_trait + CircTarget + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Self::IntroTunnel>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn m_get_or_launch_client_rend<'a, 'life0, 'async_trait>( &'life0 self, netdir: &'a NetDir, ) -> Pin<Box<dyn Future<Output = Result<(Self::DataTunnel, Relay<'a>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Client circuit

Source

fn m_estimate_timeout(&self, action: &TimeoutsAction) -> Duration

Estimate timeout

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<R: Runtime> MockableCircPool<R> for HsCircPool<R>

Source§

type DirTunnel = ClientOnionServiceDirTunnel

Source§

type DataTunnel = ClientOnionServiceDataTunnel

Source§

type IntroTunnel = ClientOnionServiceIntroTunnel

Source§

fn m_get_or_launch_dir<'life0, 'life1, 'async_trait>( &'life0 self, netdir: &'life1 NetDir, target: impl 'async_trait + CircTarget + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Self::DirTunnel>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn m_get_or_launch_intro<'life0, 'life1, 'async_trait>( &'life0 self, netdir: &'life1 NetDir, target: impl 'async_trait + CircTarget + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Self::IntroTunnel>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn m_get_or_launch_client_rend<'a, 'life0, 'async_trait>( &'life0 self, netdir: &'a NetDir, ) -> Pin<Box<dyn Future<Output = Result<(Self::DataTunnel, Relay<'a>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

fn m_estimate_timeout(&self, action: &TimeoutsAction) -> Duration

Implementors§