pub trait Close: Write {
// Required method
fn close(self) -> Result<()>;
}
Expand description
An extension trait for safely dropping I/O writers.
Required Methods§
Sourcefn close(self) -> Result<()>
fn close(self) -> Result<()>
Drops an I/O writer and closes any resource handle contained inside (such as a raw file descriptor). Ensures that I/O errors resulting from closing a handle are not ignored. The writer is flushed before any handle is closed. If any errors occur during flushing or closing the first such error is returned.
Implementations on Foreign Types§
Source§impl Close for UnixStream
impl Close for UnixStream
Source§impl Close for ChildStdin
impl Close for ChildStdin
Source§impl Close for PipeWriter
Available on crate feature os_pipe
only.
impl Close for PipeWriter
Available on crate feature
os_pipe
only.