Struct Connected

struct Connected { ... }

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() -> Connected

Create new Connected type with empty metadata.

fn proxy(self: 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.

fn is_proxied(self: &Self) -> bool

Determines if the connected transport is to an HTTP proxy.

fn extra<T: Clone + Send + Sync + 'static>(self: Self, extra: T) -> Connected

Set extra connection information to be set in the extensions of every Response.

fn get_extras(self: &Self, extensions: &mut Extensions)

Copies the extra connection information into an Extensions map.

fn negotiated_h2(self: Self) -> Connected

Set that the connected transport negotiated HTTP/2 as its next protocol.

fn is_negotiated_h2(self: &Self) -> bool

Determines if the connected transport negotiated HTTP/2 as its next protocol.

fn poison(self: &Self)

Poison this connection

A poisoned connection will not be reused for subsequent requests by the pool

impl Debug for Connected

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Freeze for Connected

impl RefUnwindSafe for Connected

impl Send for Connected

impl Sync for Connected

impl Unpin for Connected

impl UnsafeUnpin for Connected

impl UnwindSafe for Connected

impl<T> Any for Connected

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Connected

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Connected

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Connected

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Connected

impl<T> WithSubscriber for Connected

impl<T, U> Into for Connected

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Connected

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Connected

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>