[][src]Trait unsafe_io::AsUnsafeSocket

pub trait AsUnsafeSocket {
    pub fn as_unsafe_socket(&self) -> UnsafeSocket;

    pub fn as_tcp_stream_view(&self) -> View<'_, TcpStream> { ... }
pub unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream> { ... }
pub fn as_tcp_listener_view(&self) -> View<'_, TcpListener> { ... }
pub unsafe fn as_unscoped_tcp_listener_view(
        &self
    ) -> View<'static, TcpListener> { ... }
pub fn as_udp_socket_view(&self) -> View<'_, UdpSocket> { ... }
pub unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket> { ... }
pub fn as_unix_stream_view(&self) -> View<'_, UnixStream> { ... }
pub unsafe fn as_unscoped_unix_stream_view(
        &self
    ) -> View<'static, UnixStream> { ... } }

A trait for types which contain an unsafe socket and can expose it.

Required methods

pub fn as_unsafe_socket(&self) -> UnsafeSocket[src]

Return the contained unsafe socket.

Loading content...

Provided methods

pub fn as_tcp_stream_view(&self) -> View<'_, TcpStream>[src]

Utility for returning a value which dereferences to a &TcpStream or &mut TcpStream.

Note that AsUnsafeSocket may be implemented for types which are not TCP streams, and which don't support all the methods on TcpStream.

pub unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream>[src]

Like as_tcp_stream, but returns a value which is not explicitly tied to the lifetime of self.

Safety

Callers must manually ensure that the view doesn't outlive self.

pub fn as_tcp_listener_view(&self) -> View<'_, TcpListener>[src]

Utility for returning a value which dereferences to a &TcpListener or &mut TcpListener.

Note that AsUnsafeSocket may be implemented for types which are not TCP listeners, and which don't support all the methods on TcpListener.

pub unsafe fn as_unscoped_tcp_listener_view(&self) -> View<'static, TcpListener>[src]

Like as_tcp_listener, but returns a value which is not explicitly tied to the lifetime of self.

Safety

Callers must manually ensure that the view doesn't outlive self.

pub fn as_udp_socket_view(&self) -> View<'_, UdpSocket>[src]

Utility for returning a value which dereferences to a &UdpSocket or &mut UdpSocket.

Note that AsUnsafeSocket may be implemented for types which are not UDP sockets, and which don't support all the methods on UdpSocket.

pub unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket>[src]

Like as_udp_socket, but returns a value which is not explicitly tied to the lifetime of self.

Safety

Callers must manually ensure that the view doesn't outlive self.

pub fn as_unix_stream_view(&self) -> View<'_, UnixStream>[src]

Utility for returning a value which dereferences to a &UnixStream or &mut UnixStream.

Note that AsUnsafeSocket may be implemented for types which are not Unix-domain socket streams, and which don't support all the methods on UnixStream.

pub unsafe fn as_unscoped_unix_stream_view(&self) -> View<'static, UnixStream>[src]

Like as_unix_stream, but returns a value which is not explicitly tied to the lifetime of self.

Safety

Callers must manually ensure that the view doesn't outlive self.

Loading content...

Implementors

impl<T: AsRawFd> AsUnsafeSocket for T[src]

Loading content...