pub struct SeqPacket {
    fd: Arc<SafeDescriptor>,
}
Expand description

A Unix SOCK_SEQPACKET.

Fields

fd: Arc<SafeDescriptor>

Implementations

Open a SOCK_SEQPACKET connection to socket named by path.

Creates a pair of connected SOCK_SEQPACKET sockets.

Both returned file descriptors have the CLOEXEC flag set.s

Gets the number of bytes in the next packet. This blocks as if recv were called, respecting the blocking and timeout settings of the underlying socket.

Clone the underlying FD.

Writes data from buf to the socket.

Returns the number of bytes written to the socket. Note that when using I/O drivers like io_uring the data will be copied into an intermediate buffer before it is written to the socket and so this function is best suited for sending small amounts of data. Callers that want to avoid the intermediate buffer should use send_iobuf instead.

Writes buf with the provided file descriptors to the socket.

Returns the number of bytes written to the socket. Like with send, this method may copy both the data and the fds into an intermediate buffer before writing them to the socket. Callers that want to avoid copying should use send_iobuf_with_fds instead.

Writes data from buf to the socket.

This function is like send but takes an owned buffer instead, avoiding the need to first copy the data into an intermediate buffer.

Writes data from buf with the provided file descriptors to the socket.

Like send_with_fds but doesn’t require copying the data into an intermediate buffer first. Returns the number of bytes written to the socket.

Reads data from the socket into buf.

Returns the number of bytes read from the socket. Note that when using I/O drivers like io_uring the data will first be read into an intermediate buffer before it is copied into buf and so this function is best suited for reading small amounts of data. Callers that want to avoid the intermediate buffer should use recv_iobuf instead.

Reads data from the socket into buf and any file descriptors into fds.

Returns the number of bytes read from the socket and the number of file descriptors received. Note that when using I/O drivers like io_uring the data will first be read into an intermediate buffer before it is copied into buf and so this function is best suited for reading small amounts of data. Callers that want to avoid the intermediate buffer should use recv_iobuf_with_fds instead.

Reads data from the socket into buf.

This function is like recv but takes an owned buffer instead, avoiding the need to first copy the data into an intermediate buffer.

Reads data from the socket into buf and any file descriptors into fds.

Like recv_with_fds but doesn’t require copying the data into an intermediate buffer first. Returns the number of bytes read from the socket as well as the number of file descriptors received.

Reads data from the socket into a Vec<u8>.

Reads data and file descriptors from the socket.

Trait Implementations

Returns the underlying raw descriptor. Read more
Extracts the raw file descriptor. Read more
Formats the value using the given formatter. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Returns the underlying raw descriptors. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.