pub struct ChunkWriter<W: Write> { /* private fields */ }Expand description
Writing chunks to a ChunkWriter will send them to the client and flush the stream
Implementations§
Source§impl<W: Write> ChunkWriter<W>
impl<W: Write> ChunkWriter<W>
Sourcepub async fn write_chunk(&mut self, chunk: &[u8]) -> Result<(), W::Error>
pub async fn write_chunk(&mut self, chunk: &[u8]) -> Result<(), W::Error>
Write a chunk to the client.
Sourcepub async fn finalize(self) -> Result<ChunksWritten, W::Error>
pub async fn finalize(self) -> Result<ChunksWritten, W::Error>
Finish writing chunks and flush the buffer.
Auto Trait Implementations§
impl<W> Freeze for ChunkWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for ChunkWriter<W>where
W: RefUnwindSafe,
impl<W> Send for ChunkWriter<W>where
W: Send,
impl<W> Sync for ChunkWriter<W>where
W: Sync,
impl<W> Unpin for ChunkWriter<W>where
W: Unpin,
impl<W> UnwindSafe for ChunkWriter<W>where
W: UnwindSafe,
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