From 67b88547c5dddb7f72d072352ad1d63f88cb5587 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 22 Sep 2022 08:57:34 -0400 Subject: [PATCH] CircMgr: Add an accessor for the CircuitBuilder. Without this, actually building circuits manually is a pain. This API is behind the `experimental-api` feature, and so it does not require a semver.md entry. --- crates/tor-circmgr/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/tor-circmgr/src/lib.rs b/crates/tor-circmgr/src/lib.rs index 4fcb7c53e..b357a1050 100644 --- a/crates/tor-circmgr/src/lib.rs +++ b/crates/tor-circmgr/src/lib.rs @@ -498,6 +498,14 @@ impl CircMgr { } } + /// Return a reference to the associated CircuitBuilder that this CircMgr + /// will use to create its circuits. + #[cfg_attr(docsrs, doc(cfg(feature = "experimental-api")))] + #[cfg(feature = "experimental-api")] + pub fn builder(&self) -> &build::CircuitBuilder { + self.mgr.peek_builder() + } + /// If `circ_id` is the unique identifier for a circuit that we're /// keeping track of, don't give it out for any future requests. pub fn retire_circ(&self, circ_id: &UniqId) {