[][src]Trait io_close::Close

pub trait Close: Write {
    pub fn close(self) -> Result<()>;
}

An extension trait for safely dropping I/O writers containing a resource handle.

Required methods

pub fn close(self) -> Result<()>[src]

Drops an I/O writer and closes its contained resource handle (such as a raw file descriptor), ensuring I/O errors resulting from closing this handle are not ignored. The writer is flushed before its handle is closed. If any errors occur during flushing or closing the first such error is returned.

Loading content...

Implementations on Foreign Types

impl Close for File[src]

pub fn close(self) -> Result<()>[src]

Drops an I/O writer containing a raw file descriptor.

impl Close for TcpStream[src]

pub fn close(self) -> Result<()>[src]

Drops an I/O writer containing a raw file descriptor.

impl Close for UnixStream[src]

pub fn close(self) -> Result<()>[src]

Drops an I/O writer containing a raw file descriptor.

impl Close for ChildStdin[src]

pub fn close(self) -> Result<()>[src]

Drops an I/O writer containing a raw file descriptor.

impl<W: Close> Close for BufWriter<W>[src]

pub fn close(self) -> Result<()>[src]

Drops a BufWriter containing an I/O writer implementing Close.

impl<W: Close> Close for LineWriter<W>[src]

pub fn close(self) -> Result<()>[src]

Drops a LineWriter containing an I/O writer implementing Close.

Loading content...

Implementors

Loading content...