pub struct Connected { /* private fields */ }
client
and client-legacy
only.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.
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connected
impl !RefUnwindSafe for Connected
impl Send for Connected
impl Sync for Connected
impl Unpin for Connected
impl !UnwindSafe for Connected
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> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes