Skip to main content

Event

Enum Event 

Source
pub enum Event<'a> {
    Headers {
        stream: u32,
        headers: &'a Headers,
        end_stream: bool,
    },
    Data {
        stream: u32,
        data: &'a [u8],
        end_stream: bool,
    },
    Trailers {
        stream: u32,
        trailers: &'a Headers,
    },
    Reset {
        stream: u32,
        code: ErrorCode,
        remote: bool,
    },
    Settings,
    Pong {
        data: [u8; 8],
    },
    GoAway {
        last_stream: u32,
        code: ErrorCode,
        debug: &'a [u8],
    },
    Closed {
        code: ErrorCode,
    },
}
Expand description

Something the peer did, reported by Connection::recv and Connection::handle_timeout.

Variants§

§

Headers

Request headers (server), or response headers including 1xx (client).

Fields

§stream: u32
§headers: &'a Headers
§end_stream: bool
§

Data

Request or response body bytes. Call Connection::release once they are consumed.

Fields

§stream: u32
§data: &'a [u8]
§end_stream: bool
§

Trailers

Trailers; they always end the stream.

Fields

§stream: u32
§trailers: &'a Headers
§

Reset

The stream ended abnormally: reset by the peer (remote), refused by its GOAWAY, or reset by us after a stream error. Stop its work, then call Connection::stream_finished.

Fields

§stream: u32
§remote: bool
§

Settings

The peer’s SETTINGS were applied (and acknowledged).

§

Pong

The answer to Connection::ping.

Fields

§data: [u8; 8]
§

GoAway

The peer is shutting down: no stream above last_stream will be processed.

Fields

§last_stream: u32
§debug: &'a [u8]
§

Closed

We closed the connection with a GOAWAY carrying code (a connection error or an exceeded budget). Flush the output, then close the transport.

Fields

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> Forget for Event<'a>

§

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

§

impl<'a> Move for Event<'a>

§

impl<'a> RefUnwindSafe 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>

§

impl<'a> UnwindSafe 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.