io_extras::read_write

Trait AsReadWriteHandleOrSocket

Source
pub trait AsReadWriteHandleOrSocket {
    // Required methods
    fn as_read_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>;
    fn as_write_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>;
}
Expand description

Like AsHandleOrSocket, but for types which may have one or two handles or sockets, for reading and writing.

For types that only have one, both functions return the same value.

Required Methods§

Source

fn as_read_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>

Extracts the handle or socket for reading.

Like AsHandleOrSocket::as_handle_or_socket, but returns the reading handle.

Source

fn as_write_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>

Extracts the handle or socket for writing.

Like AsHandleOrSocket::as_handle_or_socket, but returns the writing handle.

Implementations on Foreign Types§

Source§

impl AsReadWriteHandleOrSocket for File

Source§

impl AsReadWriteHandleOrSocket for TcpStream

Source§

impl<T: AsReadWriteHandleOrSocket> AsReadWriteHandleOrSocket for Box<T>

Implementors§