Skip to main content

Http3

Struct Http3 

Source
pub struct Http3 { /* private fields */ }

Implementations§

Source§

impl Http3

Source

pub fn new(is_server: bool, cfg: Config) -> Self

Source

pub fn poll_event(&mut self) -> Option<H3Event>

Source

pub fn peer_connect_protocol(&self) -> Option<bool>

The peer (a server) accepts extended CONNECT (RFC 9220): its SETTINGS carried SETTINGS_ENABLE_CONNECT_PROTOCOL = 1. None until its SETTINGS arrived.

Source

pub fn peer_settings(&self) -> Option<&Settings>

The peer’s SETTINGS, once received.

Source

pub fn active_streams(&self) -> usize

Request streams currently tracked.

Source

pub fn open(&mut self, conn: &mut Connection)

Opens the control and QPACK streams and sends SETTINGS. Http3::handle does this on Event::Connected; call it directly if the connection was established before.

Source

pub fn handle(&mut self, now: Instant, conn: &mut Connection, ev: &Event)

Feeds one QUIC event of this connection.

Source

pub fn recv_body( &mut self, now: Instant, conn: &mut Connection, stream: u64, out: &mut [u8], ) -> Result<(usize, bool), SendError>

Reads body bytes; returns (bytes, finished). Finished is reported once the peer’s fin was received and every body byte was read.

Source

pub fn send_headers( &mut self, conn: &mut Connection, stream: u64, fields: &[(&[u8], &[u8])], fin: bool, ) -> Result<(), SendError>

Sends response headers (server) or request headers (client). Interim 1xx responses may precede the final one.

Source

pub fn send_body( &mut self, conn: &mut Connection, stream: u64, data: &[u8], fin: bool, ) -> Result<usize, SendError>

Sends body bytes in a DATA frame; returns how many were accepted. Zero means the stream is blocked: wait for H3Event::Writable.

Source

pub fn send_trailers( &mut self, conn: &mut Connection, stream: u64, fields: &[(&[u8], &[u8])], ) -> Result<(), SendError>

Sends trailers and finishes the stream.

Source

pub fn reset_stream(&mut self, conn: &mut Connection, stream: u64, code_: u64)

Abandons a request with a stream error (both directions).

Source

pub fn send_request( &mut self, conn: &mut Connection, fields: &[(&[u8], &[u8])], fin: bool, ) -> Result<u64, SendError>

Client: opens a request stream and sends its headers.

Source

pub fn goaway(&mut self, conn: &mut Connection) -> u64

Server: starts a graceful shutdown. Requests on streams below the returned ID are still served; later ones are rejected with H3_REQUEST_REJECTED.

Source

pub fn is_idle_after_goaway(&self) -> bool

True once GOAWAY was sent and no request streams remain.

Auto Trait Implementations§

§

impl Forget for Http3

§

impl Freeze for Http3

§

impl Move for Http3

§

impl RefUnwindSafe for Http3

§

impl Send for Http3

§

impl Sync for Http3

§

impl Unpin for Http3

§

impl UnsafeUnpin for Http3

§

impl UnwindSafe for Http3

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.