Skip to main content

Socket

Trait Socket 

Source
pub trait Socket: Debug {
    type ReadHalf: ReadHalf;
    type WriteHalf: WriteHalf;

    const CAN_TRANSFER_FDS: bool = false;

    // Required method
    fn split(self) -> (Self::ReadHalf, Self::WriteHalf);
}
Expand description

The socket trait.

This is the trait that needs to be implemented for a type to be used as a socket/transport.

Provided Associated Constants§

Source

const CAN_TRANSFER_FDS: bool = false

Whether this socket can transfer file descriptors.

This is true for Unix domain sockets and false for other socket types.

Required Associated Types§

Source

type ReadHalf: ReadHalf

The read half of the socket.

Source

type WriteHalf: WriteHalf

The write half of the socket.

Required Methods§

Source

fn split(self) -> (Self::ReadHalf, Self::WriteHalf)

Split the socket into read and write halves.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§