pub struct Connected {
pub(super) alpn: Alpn,
pub(super) is_proxied: bool,
pub(super) extra: Option<Extra>,
pub(super) poisoned: PoisonPill,
}
Expand description
Extra information about the connected transport.
This can be used to inform recipients about things like if ALPN was used, or if connected to an HTTP proxy.
Fields§
§alpn: Alpn
§is_proxied: bool
§extra: Option<Extra>
§poisoned: PoisonPill
Implementations§
source§impl Connected
impl Connected
sourcepub fn proxy(self, is_proxied: bool) -> Connected
pub fn proxy(self, is_proxied: bool) -> Connected
Set whether the connected transport is to an HTTP proxy.
This setting will affect if HTTP/1 requests written on the transport will have the request-target in absolute-form or origin-form:
- When
proxy(false)
:
GET /guide HTTP/1.1
- When
proxy(true)
:
GET http://hyper.rs/guide HTTP/1.1
Default is false
.
sourcepub fn is_proxied(&self) -> bool
pub fn is_proxied(&self) -> bool
Determines if the connected transport is to an HTTP proxy.
sourcepub fn extra<T: Clone + Send + Sync + 'static>(self, extra: T) -> Connected
pub fn extra<T: Clone + Send + Sync + 'static>(self, extra: T) -> Connected
Set extra connection information to be set in the extensions of every Response
.
sourcepub fn get_extras(&self, extensions: &mut Extensions)
pub fn get_extras(&self, extensions: &mut Extensions)
Copies the extra connection information into an Extensions
map.
sourcepub fn negotiated_h2(self) -> Connected
pub fn negotiated_h2(self) -> Connected
Set that the connected transport negotiated HTTP/2 as its next protocol.
sourcepub fn is_negotiated_h2(&self) -> bool
pub fn is_negotiated_h2(&self) -> bool
Determines if the connected transport negotiated HTTP/2 as its next protocol.
sourcepub fn poison(&self)
pub fn poison(&self)
Poison this connection
A poisoned connection will not be reused for subsequent requests by the pool