Struct Connected
pub struct Connected { /* private fields */ }
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
impl Connected
fn new() -> ConnectedCreate new
Connectedtype with empty metadata.fn proxy(self, is_proxied: bool) -> ConnectedSet 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.1Default is
false.- When
fn is_proxied(&self) -> boolDetermines if the connected transport is to an HTTP proxy.
fn extra<T: Clone + Send + Sync + 'static>(self, extra: T) -> ConnectedSet extra connection information to be set in the extensions of every
Response.fn get_extras(&self, extensions: &mut Extensions)Copies the extra connection information into an
Extensionsmap.fn negotiated_h2(self) -> ConnectedSet that the connected transport negotiated HTTP/2 as its next protocol.
fn is_negotiated_h2(&self) -> boolDetermines if the connected transport negotiated HTTP/2 as its next protocol.
fn poison(&self)Poison this connection
A poisoned connection will not be reused for subsequent requests by the pool
Trait Implementations
impl Debug for Connected
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl !RefUnwindSafe for Connected
impl !UnwindSafe for Connected
impl Freeze for Connected
impl Send for Connected
impl Sync for Connected
impl Unpin for Connected
impl UnsafeUnpin for Connected
Blanket Implementations
impl<T> Any for Connected
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Connected
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Connected
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Connected
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Connected
impl<T> WithSubscriber for Connected
impl<T, U> Into<U> for Connected
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Connected
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Connected
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>