pub struct Consumer { /* private fields */ }Expand description
Reads one frame’s payload, streaming as bytes arrive for the in-flight tail.
Owns a handle to the parent group’s channel (not a per-frame one), so a group with many frames doesn’t allocate a channel per frame. Cloning yields an independent reader of the same frame.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn poll_read_chunk(
&mut self,
waiter: &Waiter,
) -> Poll<Result<Option<Bytes>>>
pub fn poll_read_chunk( &mut self, waiter: &Waiter, ) -> Poll<Result<Option<Bytes>>>
Poll for the next chunk of bytes since the last read.
Returns None once the frame is finished and all bytes have been consumed.
Sourcepub async fn read_chunk(&mut self) -> Result<Option<Bytes>>
pub async fn read_chunk(&mut self) -> Result<Option<Bytes>>
Return the next chunk of bytes since the last read.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Consumer
impl RefUnwindSafe for Consumer
impl Send for Consumer
impl Sync for Consumer
impl Unpin for Consumer
impl UnsafeUnpin for Consumer
impl UnwindSafe for Consumer
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