pub struct BodyReader<'a, R>{ /* private fields */ }Expand description
Reader for request bodies.
Implementations§
Source§impl<'a, R> BodyReader<'a, R>
impl<'a, R> BodyReader<'a, R>
Sourcepub async fn read_next(&mut self) -> Result<Option<Bytes>, BodyError>
pub async fn read_next(&mut self) -> Result<Option<Bytes>, BodyError>
Read the next available body chunk. Returns Ok(None) once the body has
been fully consumed.
Sourcepub async fn drain(&mut self) -> Result<(), BodyError>
pub async fn drain(&mut self) -> Result<(), BodyError>
Drain the remaining body, discarding any data.
Sourcepub fn trailers(&self) -> Option<&Headers>
pub fn trailers(&self) -> Option<&Headers>
Return parsed trailers if chunked decoding completed successfully.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Indicates whether the body reader has consumed all data.
Auto Trait Implementations§
impl<'a, R> !UnwindSafe for BodyReader<'a, R>
impl<'a, R> Freeze for BodyReader<'a, R>where
BodyReaderInner<'a, R>: Freeze,
impl<'a, R> RefUnwindSafe for BodyReader<'a, R>where
BodyReaderInner<'a, R>: RefUnwindSafe,
impl<'a, R> Send for BodyReader<'a, R>where
BodyReaderInner<'a, R>: Send,
impl<'a, R> Sync for BodyReader<'a, R>where
BodyReaderInner<'a, R>: Sync,
impl<'a, R> Unpin for BodyReader<'a, R>where
BodyReaderInner<'a, R>: Unpin,
impl<'a, R> UnsafeUnpin for BodyReader<'a, R>where
BodyReaderInner<'a, R>: UnsafeUnpin,
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