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§
Sourcetype HsCircPool: MockableCircPool<R>
type HsCircPool: MockableCircPool<R>
HS circuit pool
Required Methods§
Sourcefn thread_rng(&self) -> Self::Rng
fn thread_rng(&self) -> Self::Rng
Return a random number generator
Provided Methods§
Sourcefn test_got_desc(&self, _: &HsDesc)
fn test_got_desc(&self, _: &HsDesc)
Tell tests we got this descriptor text
Sourcefn test_got_circ(
&self,
_: &Arc<<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::ClientCirc>,
)
fn test_got_circ( &self, _: &Arc<<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::ClientCirc>, )
Tell tests we got this circuit
Sourcefn test_got_ipts(&self, _: &[UsableIntroPt<'_>])
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.