Skip to main content

Module netio

Module netio 

Source
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ยง

FrameTooBig
An error indicating that a frame in a framed stream exceeded MAX_FRAME_SIZE.
ReadExactOrEof
A future which reads exactly enough bytes to fill a buffer, unless EOF is reached first.
TimedReader
An AsyncRead wrapper that enforces a timeout on each read.
TimedWriter
An AsyncWrite wrapper that enforces a timeout on each write.
UnixSocketAddr
An address associated with a Unix domain socket.

Enumsยง

DnsResolutionError
An error returned by resolve_address.
Listener
A listener bound to either a TCP socket or Unix domain socket.
SocketAddr
An address associated with an internet or Unix domain socket.
SocketAddrType
The type of a SocketAddr.
Stream
A stream associated with either a TCP socket or a Unix domain socket.

Constantsยง

MAX_FRAME_SIZE
The maximum allowable size of a frame in a framed stream.

Traitsยง

AsyncReady
Asynchronous IO readiness.

Functionsยง

ensure_url_ip_global
If urlโ€™s host is an IP literal, validates that it is a globally routable address, returning DnsResolutionError::PrivateAddress if not. Hostnames and URLs without a host are passed through; they are expected to be validated by a connector-level DNS resolver at connect time.
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, use tokio::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.