Module tokio

Source
Available on Unix and crate feature tokio_support only.
Expand description

Asynchronous Ud-sockets which work with the Tokio runtime and event loop.

The Tokio integration allows the Ud-socket streams and listeners to be notified by the OS kernel whenever they’re ready to be read from of written to, instead of spawning threads just to put them in a wait state of blocking on the I/O.

Types from this module will not work with other async runtimes, such as async-std or smol, since the Tokio types’ methods will panic whenever they’re called outside of a Tokio runtime context. Open an issue if you’d like to see other runtimes supported as well.

Structs§

BorrowedReadHalf
Borrowed read half of a UdStream, created by .split().
BorrowedWriteHalf
Borrowed write half of a UdStream, created by .split().
OwnedReadHalf
Owned read half of a UdStream, created by .into_split().
OwnedWriteHalf
Owned write half of a UdStream, created by .into_split().
ReuniteError
Error indicating that a read half and a write half were not from the same stream, and thus could not be reunited.
UdSocket
A Unix domain datagram socket, obtained either from UdSocketListener or by connecting to an existing server.
UdStream
A Unix domain socket byte stream, obtained either from UdStreamListener or by connecting to an existing server.
UdStreamListener
A Tokio-based Unix domain byte stream socket server, listening for connections.