Closed
Description
Currently, rt::io::Writer
requires a method flush(&mut self)
that flushes output. However, this does not make sense for every implementation of Writer. Specifically, libuv has no notion of flush, so none of the current I/O can do it anyway. Some implementations fail!
when called (TcpStream
, UdpSocket
) while others do nothing at all (FileStream
).
Rather than unifying the I/O system on the fail!
option or the no-op option, I'd like to suggest removing flush
from Writer
and creating a trait Flushable
that extends Writer
. We really shouldn't be implementing methods where they don't make sense when we can do otherwise.