pub struct ProxyServerBuilder { /* private fields */ }Expand description
Builder for ProxyServer.
Allows configuring the server and the inner slinger::Client.
Implementations§
Source§impl ProxyServerBuilder
impl ProxyServerBuilder
Sourcepub fn from_server(server: &ProxyServer) -> Self
pub fn from_server(server: &ProxyServer) -> Self
Start building from an existing ProxyServer configuration.
Sourcepub fn config(self, config: MitmConfig) -> Self
pub fn config(self, config: MitmConfig) -> Self
Set the MitmConfig to use.
Sourcepub fn cert_manager(self, cert_manager: Arc<CertificateManager>) -> Self
pub fn cert_manager(self, cert_manager: Arc<CertificateManager>) -> Self
Set the CertificateManager to use.
Sourcepub fn interceptor_handler(
self,
handler: Arc<RwLock<InterceptorHandler>>,
) -> Self
pub fn interceptor_handler( self, handler: Arc<RwLock<InterceptorHandler>>, ) -> Self
Set the InterceptorHandler to use.
Sourcepub fn client(self, client: Client) -> Self
pub fn client(self, client: Client) -> Self
Provide a fully constructed slinger::Client to use.
Sourcepub fn configure_client<F>(self, f: F) -> Self
pub fn configure_client<F>(self, f: F) -> Self
Configure the internal slinger::Client using a closure that accepts a
ClientBuilder and returns a configured ClientBuilder.
Sourcepub fn build(self) -> Result<ProxyServer>
pub fn build(self) -> Result<ProxyServer>
Build the ProxyServer.
Priority for creating the inner Client:
- If
clientis provided, use it. - Else if
client_configis provided, call it withClient::builder(). - Else fall back to default behavior: honor
config.upstream_proxyif present and otherwise create a default client similar toProxyServer::new.
Trait Implementations§
Source§impl Default for ProxyServerBuilder
impl Default for ProxyServerBuilder
Source§fn default() -> ProxyServerBuilder
fn default() -> ProxyServerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ProxyServerBuilder
impl !RefUnwindSafe for ProxyServerBuilder
impl Send for ProxyServerBuilder
impl Sync for ProxyServerBuilder
impl Unpin for ProxyServerBuilder
impl !UnwindSafe for ProxyServerBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more