Commit 82af5149 authored by Ian Jackson's avatar Ian Jackson
Browse files

TorClient: Add get_runtime() convenience method

parent e62afdf7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -814,6 +814,17 @@ impl<R: Runtime> TorClient<R> {
        Arc::clone(&self.circmgr)
    }

    /// Return a reference to the runtime being used by this client.
    //
    // This API is not a hostage to fortune since we already require that R: Clone,
    // and necessarily a TorClient must have a clone of it.
    //
    // We provide it simply to save callers who have a TorClient from
    // having to separately keep their own handle,
    pub fn get_runtime(&self) -> &R {
        &self.runtime
    }

    /// Get or launch an exit-suitable circuit with a given set of
    /// exit ports.
    async fn get_or_launch_exit_circ(