Skip to main content

H3BidiRequest

Struct H3BidiRequest 

Source
pub struct H3BidiRequest<Transport, Handler> { /* private fields */ }
Expand description

A pending HTTP/3 request-response cycle on one bidirectional stream, with optional per-stream hooks.

Built by H3Connection::process_inbound_bidi. Configure hooks with the with_* methods and .await it to run the cycle. New per-stream extension points are added as further with_* methods, so the entry point’s required arguments never change.

Implementations§

Source§

impl<Transport, Handler> H3BidiRequest<Transport, Handler>

Source

pub fn with_reset<R>(self, reset: R) -> Self
where R: FnOnce(&mut Transport, H3ErrorCode) + Send + 'static,

Issue a stream RST on a stream-level protocol error.

On any H3Error::Protocol(code) from first-frame processing, reset is called with the still-owned transport and the error code before the error is returned — letting the caller RST both halves of the bidi stream as RFC 9114 requires. I/O errors and successful runs do not invoke it. Without this hook, the transport is dropped without a reset.

Trait Implementations§

Source§

impl<Transport, Handler> Debug for H3BidiRequest<Transport, Handler>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Transport, Handler, Fut> IntoFuture for H3BidiRequest<Transport, Handler>
where Transport: AsyncRead + AsyncWrite + Unpin + Send + Sync + 'static, Handler: FnOnce(Conn<Transport>) -> Fut + Send + 'static, Fut: Future<Output = Conn<Transport>> + Send + 'static,

Source§

type IntoFuture = Pin<Box<dyn Future<Output = <H3BidiRequest<Transport, Handler> as IntoFuture>::Output> + Send>>

Which kind of future are we turning this into?
Source§

type Output = Result<H3StreamResult<Transport>, H3Error>

The output that the future will produce on completion.
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<Transport, Handler> !RefUnwindSafe for H3BidiRequest<Transport, Handler>

§

impl<Transport, Handler> !Sync for H3BidiRequest<Transport, Handler>

§

impl<Transport, Handler> !UnwindSafe for H3BidiRequest<Transport, Handler>

§

impl<Transport, Handler> Freeze for H3BidiRequest<Transport, Handler>
where Transport: Freeze, Handler: Freeze,

§

impl<Transport, Handler> Send for H3BidiRequest<Transport, Handler>
where Transport: Send, Handler: Send,

§

impl<Transport, Handler> Unpin for H3BidiRequest<Transport, Handler>
where Transport: Unpin, Handler: Unpin,

§

impl<Transport, Handler> UnsafeUnpin for H3BidiRequest<Transport, Handler>
where Transport: UnsafeUnpin, Handler: UnsafeUnpin,

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.