pub(crate) trait Mockable:
Clone
+ Send
+ Sync
+ Sized
+ 'static {
type Rng: Rng + CryptoRng;
type ClientCirc: MockableClientCirc;
// Required methods
fn thread_rng(&self) -> Self::Rng;
fn get_or_launch_specific<'life0, 'life1, 'async_trait, T>(
&'life0 self,
netdir: &'life1 NetDir,
kind: HsCircKind,
target: T,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::ClientCirc>, Error>> + Send + 'async_trait>>
where T: CircTarget + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn estimate_upload_timeout(&self) -> Duration;
}
Expand description
Mockable state for the descriptor publisher reactor.
This enables us to mock parts of the Reactor
for testing purposes.
Required Associated Types§
Sourcetype ClientCirc: MockableClientCirc
type ClientCirc: MockableClientCirc
The type of client circuit.
Required Methods§
Sourcefn thread_rng(&self) -> Self::Rng
fn thread_rng(&self) -> Self::Rng
Return a random number generator.
Sourcefn get_or_launch_specific<'life0, 'life1, 'async_trait, T>(
&'life0 self,
netdir: &'life1 NetDir,
kind: HsCircKind,
target: T,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::ClientCirc>, Error>> + Send + 'async_trait>>where
T: CircTarget + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_or_launch_specific<'life0, 'life1, 'async_trait, T>(
&'life0 self,
netdir: &'life1 NetDir,
kind: HsCircKind,
target: T,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::ClientCirc>, Error>> + Send + 'async_trait>>where
T: CircTarget + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a circuit of the specified kind
to target
.
Sourcefn estimate_upload_timeout(&self) -> Duration
fn estimate_upload_timeout(&self) -> Duration
Return an estimate-based value for how long we should allow a single directory upload operation to complete.
Includes circuit construction, stream opening, upload, and waiting for a response.
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.