Available on crate feature
network
only.Expand description
Network I/O utilities.
Modulesยง
- async_
ready ๐ - dns ๐
- framed ๐
- read_
exact ๐ - socket ๐
- timeout ๐
Async{Read,Write}
wrappers that enforce a configurable timeout on each I/O operation.
Structsยง
- Frame
TooBig - An error indicating that a frame in a framed stream exceeded
MAX_FRAME_SIZE
. - Read
Exact OrEof - A future which reads exactly enough bytes to fill a buffer, unless EOF is reached first.
- Timed
Reader - An
AsyncRead
wrapper that enforces a timeout on each read. - Timed
Writer - An
AsyncWrite
wrapper that enforces a timeout on each write. - Unix
Socket Addr - An address associated with a Unix domain socket.
Enumsยง
- DnsResolution
Error - An error returned by
resolve_address
. - Listener
- A listener bound to either a TCP socket or Unix domain socket.
- Socket
Addr - An address associated with an internet or Unix domain socket.
- Socket
Addr Type - The type of a
SocketAddr
. - Stream
- A stream associated with either a TCP socket or a Unix domain socket.
Constantsยง
- DUMMY_
DNS_ PORT - We must provide a port for dns resolution but dns resolution ignores the port so we use a port that is easy to spot in logs.
- MAX_
FRAME_ SIZE - The maximum allowable size of a frame in a framed stream.
Traitsยง
- Async
Ready - Asynchronous IO readiness.
Functionsยง
- read_
exact_ or_ eof - Creates a future which will read exactly enough bytes to fill
buf
, unless EOF is reached first. If a short read should be considered an error, usetokio::io::AsyncReadExt::read_exact
instead. - resolve_
address - Resolves a host address and ensures it is a global address when
enforce_global
is set. This parameter is useful when connecting to user-defined unverified addresses.