pub trait WriteLayered: Write + Bufferable {
// Required method
fn close(&mut self) -> Result<()>;
// Provided method
fn flush_with_status(&mut self, status: Status) -> Result<()> { ... }
}Expand description
An extension of std::io::Write, but adds a close function to allow
the stream to be closed and any outstanding errors to be reported, without
requiring a sync_all.
Required Methods§
Provided Methods§
Sourcefn flush_with_status(&mut self, status: Status) -> Result<()>
fn flush_with_status(&mut self, status: Status) -> Result<()>
Like Write::flush, but has a status parameter describing
the future of the stream:
Status::Ok(Activity::Active): do nothingStatus::Ok(Activity::Push): flush any buffers and transmit all dataStatus::End: flush any buffers and declare the end of the stream
Passing Status::Ok(Activity::Push) makes this behave the same as
flush().