Skip to main content

Connected

Struct Connected 

Source
pub struct Connected<'a> {
    pub id: ConnectionId,
    pub uri: &'a Uri,
    pub remote: Option<SocketAddr>,
    pub version: Version,
    pub timing: ConnectTiming,
}
Expand description

A connection was established.

Fields§

§id: ConnectionId§uri: &'a Uri

The URI whose request paid for this connection, as the transport received it — absolute, before any protocol rewrote it.

§remote: Option<SocketAddr>

The address that answered. One of possibly several tried: RFC 8305 races address families, and this is the winner, not the first candidate.

None where the connection has no IP address, which today means a Unix-domain socket (hclient_native::Native::unix_socket): there was no name, no family to race and no port. It is an Option rather than a fabricated 0.0.0.0:0 for Head::version’s reason one event over — a sentinel that is also an ordinary value gives a hook a wrong answer where the absence gives it a missing one, and only the second can be handled.

The alternative was to emit no Connected at all for such a connection, and it is worse: the Closed that follows would announce the end of a connection whose beginning was never announced, which is exactly the defect recorded for building a Closed::Failed out of wasi:http’s error codes.

§version: Version

What will be spoken on it, as negotiated — not as offered.

§timing: ConnectTiming

Trait Implementations§

Source§

impl<'a> Debug for Connected<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Connected<'a>

§

impl<'a> RefUnwindSafe for Connected<'a>

§

impl<'a> Send for Connected<'a>

§

impl<'a> Sync for Connected<'a>

§

impl<'a> Unpin for Connected<'a>

§

impl<'a> UnsafeUnpin for Connected<'a>

§

impl<'a> UnwindSafe for Connected<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.