Struct futures_util::io::LineWriter
source · [−]pub struct LineWriter<W: AsyncWrite> { /* private fields */ }
Expand description
Wrap a writer, like BufWriter
does, but prioritizes buffering lines
This was written based on std::io::LineWriter
which goes into further details
explaining the code.
Buffering is actually done using BufWriter
. This class will leverage BufWriter
to write on-each-line.
Implementations
Create a new LineWriter
with default buffer capacity. The default is currently 1KB
which was taken from std::io::LineWriter
Creates a new LineWriter
with the specified buffer capacity.
Returns a reference to buf_writer
’s internally buffered data.
Trait Implementations
Forward to buf_writer
’s BufWriter::poll_flush()
Forward to buf_writer
’s BufWriter::poll_close()
Attempt to write bytes from buf
into the object. Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for LineWriter<W> where
W: RefUnwindSafe,
impl<W> Send for LineWriter<W> where
W: Send,
impl<W> Sync for LineWriter<W> where
W: Sync,
impl<W> UnwindSafe for LineWriter<W> where
W: UnwindSafe,
Blanket Implementations
Creates a future which will entirely flush this AsyncWrite
. Read more
Creates a future which will entirely close this AsyncWrite
.
Creates a future which will write bytes from buf
into the object. Read more
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>ⓘNotable traits for WriteVectored<'_, W>impl<W: AsyncWrite + ?Sized + Unpin> Future for WriteVectored<'_, W> type Output = Result<usize>;
where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>ⓘNotable traits for WriteVectored<'_, W>impl<W: AsyncWrite + ?Sized + Unpin> Future for WriteVectored<'_, W> type Output = Result<usize>;
where
Self: Unpin,
impl<W: AsyncWrite + ?Sized + Unpin> Future for WriteVectored<'_, W> type Output = Result<usize>;
Creates a future which will write bytes from bufs
into the object using vectored
IO operations. Read more
Write data into this object. Read more
Mutably borrows from an owned value. Read more