Struct tokio_uds::UnixDatagram [] [src]

pub struct UnixDatagram { /* fields omitted */ }

An I/O object representing a Unix datagram socket.

Methods

impl UnixDatagram
[src]

[src]

Creates a new UnixDatagram bound to the specified path.

[src]

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 event loop whose handle is also provided.

[src]

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.

[src]

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

[src]

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.

[src]

Indicates to this source of events that the corresponding I/O object is no longer readable, but it needs to be.

Panics

This function will panic if called outside the context of a future's task.

[src]

Indicates to this source of events that the corresponding I/O object is no longer writable, but it needs to be.

Panics

This function will panic if called outside the context of a future's task.

[src]

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

[src]

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

[src]

Returns the local address that this socket is bound to.

[src]

Returns the address of this socket's peer.

The connect method will connect the socket to a peer.

[src]

Receives data from the socket.

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

[src]

Receives data from the socket.

On success, returns the number of bytes read.

[src]

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

[src]

Sends data on the socket to the specified address.

On success, returns the number of bytes written.

[src]

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.

[src]

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

[src]

Returns the value of the SO_ERROR option.

[src]

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).

[src]

Provides a Stream and Sink interface for reading and writing to this UnixDatagram object, using the provided UnixDatagramCodec to read and write the raw data.

Raw UnixDatagram sockets work with datagrams, but higher-level code usually wants to batch these into meaningful chunks, called "frames". This method layers framing on top of this socket by using the UnixDatagramCodec trait to handle encoding and decoding of messages frames. Note that the incoming and outgoing frame types may be distinct.

This function returns a single object that is both Stream and Sink; grouping this into a single object is often useful for layering things which require both read and write access to the underlying object.

If you want to work more directly with the streams and sink, consider calling split on the UnixDatagramFramed returned by this method, which will break them into separate objects, allowing them to interact more easily.

Trait Implementations

impl Debug for UnixDatagram
[src]

[src]

Formats the value using the given formatter.

impl AsRawFd for UnixDatagram
[src]

[src]

Extracts the raw file descriptor. Read more