Module datagram
Available on crate features
http and std only.Expand description
HTTP Datagrams and the Capsule Protocol (RFC 9297), shared by every HTTP version.
HttpDatagramSession runs on the upgraded I/O of any successful HTTP/1.x upgrade or
HTTP/2 and HTTP/3 Extended CONNECT. It sends DATAGRAM and control capsules on the
reliable data stream and, when the transport publishes NativeDatagrams (HTTP/3 with
negotiated QUIC DATAGRAM), unreliable native datagrams. handshake maps an upgrade
token onto each HTTP version; nothing above the session needs a version switch.
Modules§
- capsule
- Bounded, incremental Capsule Protocol decoding (RFC 9297 §3).
- handshake
- Upgrade-token handshakes for protocols that use the Capsule Protocol (RFC 9297 §3.2).
Structs§
- Capsule
Observation - An optional upgraded-I/O extension selecting a Capsule metadata observer. Works on reliable streams even when no native HTTP Datagram carrier is available.
- Datagram
Relay Direction - Counts for one completed forwarding direction. Native delivery is unreliable; accepting a send does not prove that the remote application received it.
- Datagram
Relay Outcome - Two independent directional outcomes; a clean half-close does not stop its sibling.
- Http
Datagram Relay - Forward a tunnel whose application explicitly selected HTTP Datagram semantics.
- Http
Datagram Session - An HTTP Datagram and Capsule Protocol session on an established request.
- Native
Datagrams - A request’s native datagram carrier, published on the upgraded I/O’s extensions.
- Native
Send Ready - A wait for native send room, from
NativeDatagramChannel::send_ready. - Session
Config - Configuration of an
HttpDatagramSession. - Session
Receiver - The receiving half of an
HttpDatagramSession. - Session
Sender - The sending half of an
HttpDatagramSession.
Enums§
- Datagram
Transport - How an HTTP Datagram travelled.
- Native
Recv Error - The receive side of a native association ended abnormally.
- Native
Send Error - A native datagram could not be handed to the transport.
- Native
Send Policy - How a native send behaves when the transport’s datagram buffer is full.
- Session
Error - A session operation failed.
- Session
Event - An event received on a session.
- Violation
Policy - How peer violations of HTTP Datagram rules that do not affect framing are handled.
Traits§
- Capsule
Observer - A synchronous metadata observer. Methods must finish promptly without I/O, blocking or reentering the session. Header metadata contains no value bytes. Retained data and callback failures belong to the observer; observations must not control protocol behavior.
- Native
Datagram Channel - Unreliable delivery of HTTP Datagrams associated with one request, such as HTTP/3 QUIC DATAGRAM frames (RFC 9297 §2.1).