Trait MocksForConnect

Source
trait MocksForConnect<R>: Clone {
    type HsCircPool: MockableCircPool<R>;
    type Rng: Rng + CryptoRng;

    // Required method
    fn thread_rng(&self) -> Self::Rng;

    // Provided methods
    fn test_got_desc(&self, _: &HsDesc) { ... }
    fn test_got_circ(
        &self,
        _: &Arc<<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::ClientCirc>,
    ) { ... }
    fn test_got_ipts(&self, _: &[UsableIntroPt<'_>]) { ... }
}
Expand description

Mocks used for testing connect.rs

This is different to MockableConnectorData, which is used to replace this file, when testing state.rs.

MocksForConnect provides mock facilities for testing this file.

Required Associated Types§

Source

type HsCircPool: MockableCircPool<R>

HS circuit pool

Source

type Rng: Rng + CryptoRng

A random number generator

Required Methods§

Source

fn thread_rng(&self) -> Self::Rng

Return a random number generator

Provided Methods§

Source

fn test_got_desc(&self, _: &HsDesc)

Tell tests we got this descriptor text

Source

fn test_got_circ( &self, _: &Arc<<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::ClientCirc>, )

Tell tests we got this circuit

Source

fn test_got_ipts(&self, _: &[UsableIntroPt<'_>])

Tell tests we have obtained and sorted the intros like this

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.

Implementations on Foreign Types§

Source§

impl<R: Runtime> MocksForConnect<R> for ()

Source§

type HsCircPool = HsCircPool<R>

Source§

type Rng = ThreadRng

Source§

fn thread_rng(&self) -> Self::Rng

Implementors§