trait MocksForConnect<R>: Clone {
type HsCircPool: MockableCircPool<R>;
type Rng: Rng + CryptoRng;
type KeyGenerator: KeyGenerator + Send;
// Required methods
fn thread_rng(&self) -> Self::Rng;
fn rendezvous_handshake(
&self,
handshake_state: HsNtorClientState,
rend2_msg: Rendezvous2,
intro_index: IntroPtIndex,
rend_pt: &Redacted<RelayIds>,
) -> Result<Self::KeyGenerator, FAE>;
// Provided methods
fn test_got_desc(&self, _: &HsDesc) { ... }
fn test_got_tunnel(
&self,
_: &<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::DataTunnel,
) { ... }
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
Sourcetype KeyGenerator: KeyGenerator + Send
type KeyGenerator: KeyGenerator + Send
Key generator used for generating the keys for the virtual hop.
Required Methods§
Sourcefn thread_rng(&self) -> Self::Rng
fn thread_rng(&self) -> Self::Rng
Return a random number generator
Sourcefn rendezvous_handshake(
&self,
handshake_state: HsNtorClientState,
rend2_msg: Rendezvous2,
intro_index: IntroPtIndex,
rend_pt: &Redacted<RelayIds>,
) -> Result<Self::KeyGenerator, FAE>
fn rendezvous_handshake( &self, handshake_state: HsNtorClientState, rend2_msg: Rendezvous2, intro_index: IntroPtIndex, rend_pt: &Redacted<RelayIds>, ) -> Result<Self::KeyGenerator, FAE>
Complete the rendezvous handshake, returning the resulting keygen
Provided Methods§
Sourcefn test_got_desc(&self, _: &HsDesc)
fn test_got_desc(&self, _: &HsDesc)
Tell tests we got this descriptor text
Sourcefn test_got_tunnel(
&self,
_: &<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::DataTunnel,
)
fn test_got_tunnel( &self, _: &<<Self as MocksForConnect<R>>::HsCircPool as MockableCircPool<R>>::DataTunnel, )
Tell tests we got this data tunnel.
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".