//! Types for conveniently constructing a TorRelay. use tor_rtcompat::Runtime; use crate::{config::TorRelayConfig, TorRelay}; /// An object for constructing a [`TorRelay`]. /// /// Returned by [`TorRelay::builder()`]. #[derive(Clone)] #[must_use] pub struct TorRelayBuilder { /// The runtime for the client to use runtime: R, /// The configuration. #[allow(unused)] // TODO RELAY remove config: TorRelayConfig, } impl TorRelayBuilder { /// Construct a new TorClientBuilder with the given runtime. pub(crate) fn new(runtime: R) -> Self { Self { runtime, config: TorRelayConfig::default(), } } /// Return a newly created TorRelay object. pub fn create(&self) -> TorRelay { TorRelay::create_inner(self.runtime.clone()) } }