Skip to main content

Crate hclient_rt

Crate hclient_rt 

Source
Expand description

Runtime capabilities for hclient’s native transport.

Separate traits rather than one Runtime: the transport demands only what it uses, and a backend without sockets isn’t forced to implement connect with a stub that panics.

Structs§

Cancelled
The background thread pool that Blocking::run was supposed to run on went away before the task got to start — for example, the runtime is shutting down while the task is still queued. No payload: this is not a failure of f (f never ran at all), but a signal from the runtime that there will be no result.
Datagrams
One send: a destination, and between one and many datagrams.
Discard
Timer is defined once, in hclient-core: the portable core needs it for timeouts and backoff. This is just a re-export.
FuturesIo
Bridges futures_io::{AsyncRead, AsyncWrite}hyper::rt::{Read, Write}.
RecvMeta
What one UdpDatagrams::poll_recv slot received.
TcpOpts
Socket options are applied in hclient once, on the socket2::Socket, and the runtime only adopts the descriptor (TcpAdoptStd). Otherwise every runtime crate would rewrite this whole rigmarole again.
TcpOptsSupport
Which of TcpOpts’ six fields a runtime can actually apply.
UdpCaps
Which offloads a socket has.
UnixSocketsUnsupported
A runtime that declares no Unix-domain support was asked for a connection to one.
UnsupportedTcpOpts
The caller set socket options this runtime cannot apply.
UnsupportedUdpOffload
The caller asked for an offload this socket does not have.

Enums§

EcnCodepoint
An ECN codepoint, in the two bits of the IP header’s TOS/traffic-class field that carry it.

Traits§

Blocking
A separate trait, not a method: getaddrinfo blocks, and wasm and embedded have no blocking pool at all. The absence of the capability must be a compile error, not an unimplemented!() in the runtime.
Spawn
The shape is deliberately copied from hyper::rt::Executor: generic over the future, zero bounds in the declaration. Send is added by the impl, not the trait, so single-threaded runtimes can implement it honestly.
TcpAdoptStd
On platforms with file descriptors, the whole set of socket options is applied outside the runtime, and the runtime only adopts the finished socket.
TcpConnect
Timer
Timer is defined once, in hclient-core: the portable core needs it for timeouts and backoff. This is just a re-export.
UdpAdoptStd
Adopt an already-created std::net::UdpSocket.
UdpBind
Bind a UDP socket.
UdpDatagrams
Datagram I/O on a bound socket.