Struct futures::io::LineWriter [−][src]
pub struct LineWriter<W> where
W: AsyncWrite, { /* fields omitted */ }
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
pub fn poll_flush(
self: Pin<&mut LineWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_flush(
self: Pin<&mut LineWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Forward to buf_writer
’s BufWriter::poll_flush()
pub fn poll_close(
self: Pin<&mut LineWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_close(
self: Pin<&mut LineWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
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 mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>ⓘNotable traits for WriteVectored<'_, W>impl<'_, W> Future for WriteVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>;
where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>ⓘNotable traits for WriteVectored<'_, W>impl<'_, W> Future for WriteVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>;
where
Self: Unpin,
impl<'_, W> Future for WriteVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>;
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
fn write_all_vectored(
&'a mut self,
bufs: &'a mut [IoSlice<'a>]
) -> WriteAllVectored<'a, Self>ⓘNotable traits for WriteAllVectored<'_, W>impl<'_, W> Future for WriteAllVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
where
Self: Unpin,
fn write_all_vectored(
&'a mut self,
bufs: &'a mut [IoSlice<'a>]
) -> WriteAllVectored<'a, Self>ⓘNotable traits for WriteAllVectored<'_, W>impl<'_, W> Future for WriteAllVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
where
Self: Unpin,
impl<'_, W> Future for WriteAllVectored<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
Attempts to write multiple buffers into this writer. Read more
Wraps an AsyncWrite
in a compatibility wrapper that allows it to be
used as a futures 0.1 / tokio-io 0.1 AsyncWrite
.
Requires the io-compat
feature to enable. Read more
Mutably borrows from an owned value. Read more