pub struct ConnectionMetadataBuilder { /* private fields */ }
Expand description
Builder type that is used to construct a ConnectionMetadata
value.
Implementations§
source§impl ConnectionMetadataBuilder
impl ConnectionMetadataBuilder
sourcepub fn proxied(self, proxied: bool) -> Self
pub fn proxied(self, proxied: bool) -> Self
Set whether or not the associated connection is to an HTTP proxy.
sourcepub fn set_proxied(&mut self, proxied: Option<bool>) -> &mut Self
pub fn set_proxied(&mut self, proxied: Option<bool>) -> &mut Self
Set whether or not the associated connection is to an HTTP proxy.
sourcepub fn remote_addr(self, remote_addr: SocketAddr) -> Self
pub fn remote_addr(self, remote_addr: SocketAddr) -> Self
Set the remote address of the connection used.
sourcepub fn set_remote_addr(&mut self, remote_addr: Option<SocketAddr>) -> &mut Self
pub fn set_remote_addr(&mut self, remote_addr: Option<SocketAddr>) -> &mut Self
Set the remote address of the connection used.
sourcepub fn local_addr(self, local_addr: SocketAddr) -> Self
pub fn local_addr(self, local_addr: SocketAddr) -> Self
Set the local address of the connection used.
sourcepub fn set_local_addr(&mut self, local_addr: Option<SocketAddr>) -> &mut Self
pub fn set_local_addr(&mut self, local_addr: Option<SocketAddr>) -> &mut Self
Set the local address of the connection used.
sourcepub fn poison_fn(self, poison_fn: impl Fn() + Send + Sync + 'static) -> Self
pub fn poison_fn(self, poison_fn: impl Fn() + Send + Sync + 'static) -> Self
Set a closure which will poison the associated connection.
A poisoned connection will not be reused for subsequent requests by the pool
sourcepub fn set_poison_fn(
&mut self,
poison_fn: Option<impl Fn() + Send + Sync + 'static>,
) -> &mut Self
pub fn set_poison_fn( &mut self, poison_fn: Option<impl Fn() + Send + Sync + 'static>, ) -> &mut Self
Set a closure which will poison the associated connection.
A poisoned connection will not be reused for subsequent requests by the pool
sourcepub fn build(self) -> ConnectionMetadata
pub fn build(self) -> ConnectionMetadata
Build a ConnectionMetadata
value.
§Panics
If either the is_proxied
or poison_fn
has not been set, then this method will panic