pub struct BodyReader { /* private fields */ }Expand description
Consumer end — stored in the reader registry.
Uses tokio::sync::Mutex so we can .await the receiver without holding
the registry’s std::sync::Mutex.
Implementations§
Source§impl BodyReader
impl BodyReader
Sourcepub async fn next_chunk(&self) -> Option<Bytes>
pub async fn next_chunk(&self) -> Option<Bytes>
Receive the next chunk. Returns None when the writer is gone (EOF)
or when the reader has been cancelled.
Auto Trait Implementations§
impl Freeze for BodyReader
impl !RefUnwindSafe for BodyReader
impl Send for BodyReader
impl Sync for BodyReader
impl Unpin for BodyReader
impl UnsafeUnpin for BodyReader
impl !UnwindSafe for BodyReader
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