pub struct ResponseReader<R> { /* private fields */ }Expand description
Sequential client input sharing the native request body’s chunk decoder. The matching request head supplies HEAD/CONNECT semantics. This reader does not queue outstanding requests; the owner pairs each response in wire order. Switch responses expose raw input only; coordinating the outgoing switch and managed bidirectional client bodies is not implemented here.
Implementations§
Source§impl<R: ReadableStream> ResponseReader<R>
impl<R: ReadableStream> ResponseReader<R>
pub fn new(reader: R, options: Options) -> Result<Self, Error>
pub fn is_reusable(&self) -> bool
Sourcepub async fn read_response<I: InterimHandler>(
&mut self,
request: &RequestMetadata,
interim: &mut InterimResponses<I>,
cancellation: &Cancellation,
) -> Result<Response<IncomingBody<'_, R>>, Error>
pub async fn read_response<I: InterimHandler>( &mut self, request: &RequestMetadata, interim: &mut InterimResponses<I>, cancellation: &Cancellation, ) -> Result<Response<IncomingBody<'_, R>>, Error>
Deliver interim heads in order, then return the final response. 101
and successful CONNECT yield raw input and permanently end HTTP reuse.
The connection owner supervises the independent request-writing lane.
pub async fn close(&mut self) -> Result<()>
Auto Trait Implementations§
impl<R> Freeze for ResponseReader<R>where
RequestReader<R>: Freeze,
impl<R> RefUnwindSafe for ResponseReader<R>where
RequestReader<R>: RefUnwindSafe,
impl<R> Send for ResponseReader<R>where
RequestReader<R>: Send,
impl<R> Sync for ResponseReader<R>where
RequestReader<R>: Sync,
impl<R> Unpin for ResponseReader<R>where
RequestReader<R>: Unpin,
impl<R> UnsafeUnpin for ResponseReader<R>where
RequestReader<R>: UnsafeUnpin,
impl<R> UnwindSafe for ResponseReader<R>where
RequestReader<R>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more