Trait io_close::Close[][src]

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

An extension trait for safely dropping I/O writers.

Required methods

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

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.

Loading content...

Implementations on Foreign Types

impl Close for File[src]

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

Drops an I/O writer containing a raw handle.

impl Close for TcpStream[src]

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

Drops an I/O writer containing a raw socket.

impl Close for ChildStdin[src]

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

Drops an I/O writer containing a raw handle.

impl Close for PipeWriter[src]

This is supported on crate feature os_pipe only.

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

Drops an I/O writer containing a raw handle.

impl Close for &mut [u8][src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Cursor<&mut Vec<u8>>[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Cursor<&mut [u8]>[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Cursor<Box<[u8]>>[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Cursor<Vec<u8>>[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Sink[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

impl Close for Vec<u8>[src]

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

Drops an I/O writer for which close() never produces an error, and for which flushing is unnecessary.

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

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

Drops an I/O writer which can be unwrapped using into_inner() to return an underlying writer.

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

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

Drops an I/O writer which can be unwrapped using into_inner() to return an underlying writer.

Loading content...

Implementors

Loading content...