pub struct RequestReader<R> { /* private fields */ }Expand description
Sequential request admission. Input read-ahead survives body completion and protocol switches. Failed reads and dropped head reads prohibit further admission; a dropped or cancelled body read loses no input.
Implementations§
Source§impl<R: ReadableStream> RequestReader<R>
impl<R: ReadableStream> RequestReader<R>
pub fn new(reader: R, options: Options) -> Result<Self, Error>
pub fn is_reusable(&self) -> bool
Sourcepub async fn read_request(
&mut self,
cancellation: &Cancellation,
) -> Result<Option<(Request<IncomingBody<'_, R>>, Exchange)>, Error>
pub async fn read_request( &mut self, cancellation: &Cancellation, ) -> Result<Option<(Request<IncomingBody<'_, R>>, Exchange)>, Error>
Clean EOF between requests returns None; partial heads are errors.
Auto Trait Implementations§
impl<R> Freeze for RequestReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for RequestReader<R>where
R: RefUnwindSafe,
impl<R> Send for RequestReader<R>where
R: Send,
impl<R> Sync for RequestReader<R>where
R: Sync,
impl<R> Unpin for RequestReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for RequestReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for RequestReader<R>where
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