pub struct ConnectionMetadataBuilder { /* private fields */ }
client
only.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
Trait Implementations§
source§impl Debug for ConnectionMetadataBuilder
impl Debug for ConnectionMetadataBuilder
source§impl Default for ConnectionMetadataBuilder
impl Default for ConnectionMetadataBuilder
source§fn default() -> ConnectionMetadataBuilder
fn default() -> ConnectionMetadataBuilder
Auto Trait Implementations§
impl Freeze for ConnectionMetadataBuilder
impl !RefUnwindSafe for ConnectionMetadataBuilder
impl Send for ConnectionMetadataBuilder
impl Sync for ConnectionMetadataBuilder
impl Unpin for ConnectionMetadataBuilder
impl !UnwindSafe for ConnectionMetadataBuilder
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more