tor_circmgr/hspool/
config.rs

1//! Configuration logic for `HsCircPool`.
2
3use tor_basic_utils::define_accessor_trait;
4
5define_accessor_trait! {
6    /// Configuration for an `HsCircPool`.
7    ///
8    /// If the `HsCircPool` gains new configurabilities, this trait will gain additional
9    /// supertraits, as an API break.
10    ///
11    /// Prefer to use `TorClientConfig`, which will always implement this trait.
12    //
13    // This arrangement is very like that for `CircMgrConfig`.
14    pub trait HsCircPoolConfig {
15        +
16        // Note: ideally this would be defined in the same way as `path_rules`,
17        // `circuit_timing`, etc., but define_accessor_trait unconditionally adds
18        // AsRef<VanguardsConfig> as a supertrait, which can't be cfg'd behind
19        // the vanguards feature.
20
21        /// Access the field
22        #[cfg(all(feature = "vanguards", feature = "hs-common"))]
23        fn vanguard_config(&self) -> &tor_guardmgr::VanguardConfig;
24    }
25}