Struct ::exo::Writer

Overview

An async reader for files or other potential huge amount of data. It allows to only read the data, which is needed, which saves memory and computing cost.

Methods

fn copy(self, reader: Reader) -> Tuple

Consumes the writer and takes a reader which will consumed. Starts a background process which will copy all content from the reader into the writer. Flushes and closes the writer at the end.

async fn write(self, bytes: Bytes) -> Result

Write the provided bytes into the buffer

async fn write_str(self, str: String) -> Result

Write the provided string into the buffer

async fn write_json(self, value) -> Result

Write the provided value as json formatted into the buffer

async fn flush(self) -> Result

Flushes this writer ensures that all data is written out

async fn shutdown(self) -> Result

Closes the stream and flushes all data out