tor_proto/util/timeout.rs
1//! An estimator for various timeouts.
2
3use std::time::Duration;
4
5/// An object used by circuits to compute various timeouts.
6///
7// This is implemented for the timeout `Estimator` from tor-circmgr.
8pub trait TimeoutEstimator: Send + Sync {
9 /// The estimated circuit build timeout for a circuit of the specified length.
10 ///
11 // Used by the circuit reactor for deciding when to expire half-streams.
12 fn circuit_build_timeout(&self, length: usize) -> Duration;
13}