Struct base::ScmSocket

source ·
pub struct ScmSocket<T: AsRawDescriptor> {
    pub(in sys) socket: T,
}
Expand description

Trait for file descriptors can send and receive socket control messages via sendmsg and recvmsg.

On Linux, this uses MSG_NOSIGNAL to avoid triggering signals. On MacOS, this sets the SO_NOSIGPIPE option on the file descriptor to avoid triggering signals.

Fields§

§socket: T

Implementations§

Sends the given data and file descriptors over the socket.

On success, returns the number of bytes sent.

The error is constructed via std::io::Error::last_os_error().

Arguments
  • buf - A buffer of data to send on the socket.
  • fds - A list of file descriptors to be sent.

Sends the given data and file descriptors over the socket.

On success, returns the number of bytes sent.

The error is constructed via std::io::Error::last_os_error().

Arguments
  • bufs - A slice of buffers of data to send on the socket.
  • fds - A list of file descriptors to be sent.

Receives data and file descriptors from the socket.

On success, returns the number of bytes and file descriptors received as a tuple (bytes count, descriptors).

The error is constructed via std::io::Error::last_os_error().

Arguments
  • buf - A buffer to store received data.
  • max_descriptors - Maximum number of file descriptors to receive.

Receives data and file descriptors from the socket.

On success, returns the number of bytes and file descriptors received as a tuple (bytes count, files count).

The error is constructed via std::io::Error::last_os_error().

Arguments
  • bufs - A slice of buffers to store received data.
  • max_descriptors - Maximum number of file descriptors to receive.

Receives data and potentially a file descriptor from the socket.

On success, returns the number of bytes and an optional file descriptor.

The error is constructed via std::io::Error::last_os_error().

Arguments
  • buf - A buffer to receive data from the socket.vm

Returns a reference to the wrapped instance.

Returns a mutable reference to the wrapped instance.

Returns the inner object, destroying the ScmSocket.

Trait Implementations§

Returns the underlying raw descriptor. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. 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.
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.
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.