You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the Writer adaptors that libstd provides that have some sort of internal buffer should expose a method named .flush_outer() that flushes this internal buffer. Basically, whatever it does in .flush() besides flushing the inner writer. For example, in BufferedWriter it would be the flush_buf() method.
This would be useful when the client needs to handle errors from this shallow flush but doesn't want to flush the full writer stack. For example, before calling BufferedWriter.unwrap(), the client could use .flush_buf() to get the error, as BufferedWriter.unwrap() will fail otherwise.
Similarly, LineBufferedWriter could call self.inner.flush_outer() in write() instead of calling self.inner.flush().
The text was updated successfully, but these errors were encountered:
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.
All the
Writer
adaptors that libstd provides that have some sort of internal buffer should expose a method named.flush_outer()
that flushes this internal buffer. Basically, whatever it does in.flush()
besides flushing the inner writer. For example, inBufferedWriter
it would be theflush_buf()
method.This would be useful when the client needs to handle errors from this shallow flush but doesn't want to flush the full writer stack. For example, before calling
BufferedWriter.unwrap()
, the client could use.flush_buf()
to get the error, asBufferedWriter.unwrap()
will fail otherwise.Similarly,
LineBufferedWriter
could callself.inner.flush_outer()
inwrite()
instead of callingself.inner.flush()
.The text was updated successfully, but these errors were encountered: