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>>>
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>>
The next chunk of bytes since the last read.
Returns None once the frame is finished and all bytes have been consumed.
Awaits poll_read_chunk.
Sourcepub fn poll_read_all(&mut self, waiter: &Waiter) -> Poll<Result<Bytes>>
pub fn poll_read_all(&mut self, waiter: &Waiter) -> Poll<Result<Bytes>>
Return all remaining bytes once the frame is finished.
Sourcepub async fn read_all(&mut self) -> Result<Bytes>
pub async fn read_all(&mut self) -> Result<Bytes>
Return all remaining bytes once the frame is finished.
Awaits poll_read_all.
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