pub struct GroupProducer {
pub info: Group,
/* private fields */
}Expand description
Writes frames to a group in order.
Each group is delivered independently over a QUIC stream. Use Self::write_frame for simple single-buffer frames, or Self::create_frame for multi-chunk streaming writes.
Fields§
§info: GroupThe group header containing the sequence number.
Implementations§
Source§impl GroupProducer
impl GroupProducer
Sourcepub fn write_frame<B: Into<Bytes>>(&mut self, frame: B) -> Result<()>
pub fn write_frame<B: Into<Bytes>>(&mut self, frame: B) -> Result<()>
A helper method to write a frame from a single byte buffer.
If you want to write multiple chunks, use Self::create_frame to get a frame producer. But an upfront size is required.
Sourcepub fn create_frame(&mut self, info: Frame) -> Result<FrameProducer>
pub fn create_frame(&mut self, info: Frame) -> Result<FrameProducer>
Create a frame with an upfront size
Sourcepub fn append_frame(&mut self, frame: FrameProducer) -> Result<()>
pub fn append_frame(&mut self, frame: FrameProducer) -> Result<()>
Append a frame producer to the group.
Sourcepub fn finish(&mut self) -> Result<()>
pub fn finish(&mut self) -> Result<()>
Mark the group as complete; no more frames will be written.
Sourcepub fn abort(&mut self, err: Error) -> Result<()>
pub fn abort(&mut self, err: Error) -> Result<()>
Abort the group with the given error.
No updates can be made after this point.
Sourcepub fn consume(&self) -> GroupConsumer
pub fn consume(&self) -> GroupConsumer
Create a new consumer for the group.
Trait Implementations§
Source§impl Clone for GroupProducer
impl Clone for GroupProducer
Auto Trait Implementations§
impl Freeze for GroupProducer
impl RefUnwindSafe for GroupProducer
impl Send for GroupProducer
impl Sync for GroupProducer
impl Unpin for GroupProducer
impl UnsafeUnpin for GroupProducer
impl UnwindSafe for GroupProducer
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