summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/util/timeout.rs
blob: f2a6bc8557f93720fe62b2b7a137096113193cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! An estimator for various timeouts.

use std::time::Duration;

/// An object used by circuits to compute various timeouts.
///
// This is implemented for the timeout `Estimator` from tor-circmgr.
pub trait TimeoutEstimator: Send + Sync {
    /// The estimated circuit build timeout for a circuit of the specified length.
    ///
    // Used by the circuit reactor for deciding when to expire half-streams.
    fn circuit_build_timeout(&self, length: usize) -> Duration;
}