Struct tokio::net::UnixDatagram

source ·
pub struct UnixDatagram { /* private fields */ }
Expand description

An I/O object representing a Unix datagram socket.

Implementations§

Creates a new UnixDatagram bound to the specified path.

Creates an unnamed pair of connected sockets.

This function will create a pair of interconnected Unix sockets for communicating back and forth between one another. Each socket will be associated with the default event loop’s handle.

Consumes a UnixDatagram in the standard library and returns a nonblocking UnixDatagram from this crate.

The returned datagram will be associated with the given event loop specified by handle and is ready to perform I/O.

Creates a new UnixDatagram which is not bound to any address.

Connects the socket to the specified address.

The send method may be used to send data to the specified address. recv and recv_from will only receive data from that address.

Test whether this socket is ready to be read or not.

Test whether this socket is ready to be written to or not.

Returns the local address that this socket is bound to.

Returns the address of this socket’s peer.

The connect method will connect the socket to a peer.

Receives data from the socket.

On success, returns the number of bytes read and the address from whence the data came.

Receives data from the socket.

On success, returns the number of bytes read.

Returns a future for receiving a datagram. See the documentation on RecvDgram for details.

Sends data on the socket to the specified address.

On success, returns the number of bytes written.

Sends data on the socket to the socket’s peer.

The peer address may be set by the connect method, and this method will return an error if the socket has not already been connected.

On success, returns the number of bytes written.

Returns a future sending the data in buf to the socket at path.

Returns the value of the SO_ERROR option.

Shut down the read, write, or both halves of this connection.

This function will cause all pending and future I/O calls on the specified portions to immediately return with an appropriate value (see the documentation of Shutdown).

Trait Implementations§

Extracts the raw file descriptor. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. 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.