Skip to main content

Event

Enum Event 

Source
pub enum Event<'a> {
    Connected(Connected<'a>),
    Reused(Reused<'a>),
    Head(Head<'a>),
    Closed(Closed<'a>),
    Informational(Informational<'a>),
}
Expand description

What a transport reports.

Not #[non_exhaustive], for Message’s reason (see Message): nothing here is published, so a new variant costs a rebase inside this workspace, and a compile error is what an implementer of Hooks should get when the vocabulary grows — rather than a silently ignored fact.

There is deliberately no “request queued” variant. The original list for this work had one, and hclient-native has nothing to put in it: a request that finds no live pooled connection dials a fresh one, there is no per-origin connection limit to wait behind, and an h2 connection is checked out of the pool exclusively — one stream at a time — so SendRequest::poll_ready never waits for a stream of ours. A variant no code can emit is a capability that lies; this one belongs here once a backend has a queue.

Variants§

§

Connected(Connected<'a>)

A connection was made. See Connected for what each duration means and, more to the point, what it does not.

§

Reused(Reused<'a>)

A connection somebody else already made is being used again.

§

Head(Head<'a>)

The response head arrived.

§

Closed(Closed<'a>)

A connection ended, and why.

§

Informational(Informational<'a>)

A 1xx arrived ahead of the response — 100 Continue, 103 Early Hints, or anything else a server sends before the one answer the caller is waiting for.

An event rather than a response, because it is not one: a 1xx is not the end of the exchange and Transport::execute resolves exactly once. A caller who wants 103’s preload hints reads them here, before the head that follows.

Trait Implementations§

Source§

impl<'a> Debug for Event<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Event<'a>

§

impl<'a> !UnwindSafe for Event<'a>

§

impl<'a> Freeze for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'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.