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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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