circmgr: Declare builder() unconditionally.

(Still, only expose it when experimental-api is enabled.)
This commit is contained in:
Nick Mathewson 2023-03-16 13:06:18 -04:00
parent 5b3c6b6bb3
commit 35967ca38d
3 changed files with 19 additions and 7 deletions

1
Cargo.lock generated
View File

@ -3769,6 +3769,7 @@ dependencies = [
"tor-rtcompat", "tor-rtcompat",
"tor-rtmock", "tor-rtmock",
"tracing", "tracing",
"visibility",
"weak-table", "weak-table",
] ]

View File

@ -26,7 +26,7 @@ testing = []
# These APIs are not covered by semantic versioning. Using this # These APIs are not covered by semantic versioning. Using this
# feature voids your "semver warrantee". # feature voids your "semver warrantee".
experimental = ["experimental-api", "hs-client", "hs-service"] experimental = ["experimental-api", "hs-client", "hs-service"]
experimental-api = [] experimental-api = ["visibility"]
hs-client = ["hs-common"] hs-client = ["hs-common"]
hs-service = ["hs-common"] hs-service = ["hs-common"]
hs-common = ["tor-hscrypto"] hs-common = ["tor-hscrypto"]
@ -63,15 +63,25 @@ tor-persist = { path = "../tor-persist", version = "0.6.2" }
tor-proto = { path = "../tor-proto", version = "0.9.0" } tor-proto = { path = "../tor-proto", version = "0.9.0" }
tor-rtcompat = { path = "../tor-rtcompat", version = "0.8.1" } tor-rtcompat = { path = "../tor-rtcompat", version = "0.8.1" }
tracing = "0.1.18" tracing = "0.1.18"
visibility = { version = "0.0.1", optional = true }
weak-table = "0.3.0" weak-table = "0.3.0"
[dev-dependencies] [dev-dependencies]
futures-await-test = "0.3.0" futures-await-test = "0.3.0"
tor-guardmgr = { path = "../tor-guardmgr", version = "0.8.2", features = ["testing"] } tor-guardmgr = { path = "../tor-guardmgr", version = "0.8.2", features = [
"testing",
] }
tor-llcrypto = { path = "../tor-llcrypto", version = "0.4.2" } tor-llcrypto = { path = "../tor-llcrypto", version = "0.4.2" }
tor-netdir = { path = "../tor-netdir", version = "0.8.0", features = ["testing"] } tor-netdir = { path = "../tor-netdir", version = "0.8.0", features = [
tor-persist = { path = "../tor-persist", version = "0.6.2", features = ["testing"] } "testing",
tor-rtcompat = { path = "../tor-rtcompat", version = "0.8.1", features = ["tokio", "native-tls"] } ] }
tor-persist = { path = "../tor-persist", version = "0.6.2", features = [
"testing",
] }
tor-rtcompat = { path = "../tor-rtcompat", version = "0.8.1", features = [
"tokio",
"native-tls",
] }
tor-rtmock = { path = "../tor-rtmock", version = "0.7.0" } tor-rtmock = { path = "../tor-rtmock", version = "0.7.0" }
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true

View File

@ -526,8 +526,9 @@ impl<R: Runtime> CircMgr<R> {
/// Return a reference to the associated CircuitBuilder that this CircMgr /// Return a reference to the associated CircuitBuilder that this CircMgr
/// will use to create its circuits. /// will use to create its circuits.
#[cfg_attr(docsrs, doc(cfg(feature = "experimental-api")))] #[cfg_attr(docsrs, doc(cfg(feature = "experimental-api")))]
#[cfg(feature = "experimental-api")] #[cfg_attr(feature = "experimental-api", visibility::make(pub))]
pub fn builder(&self) -> &build::CircuitBuilder<R> { #[allow(dead_code)]
pub(crate) fn builder(&self) -> &build::CircuitBuilder<R> {
self.mgr.peek_builder() self.mgr.peek_builder()
} }