Skip to main content

Crate udp

Crate udp 

Available on crate features std and udp only.
Expand description

Protocol-neutral UDP module for Rama.

Applications use the reexported Tokio UdpSocket and the simple bind helpers. Packet-oriented protocols use the runtime-neutral DatagramSocket and DatagramSender traits, with UdpPacketSocket as the Tokio-backed implementation. test_utils provides a deterministic in-memory backend when its feature is enabled.

This crate reports socket implementation limits and ancillary capabilities. It does not infer a path MTU or provide congestion control, retransmission, or other upper-transport behavior.

§Rama

Crate used by the end-user rama crate and rama crate authors alike.

Learn more about rama:

Modules§

proxy
Bounded, packet-preserving forwarding between two fixed UDP peers: the datagram counterpart of forwarding a byte stream untouched.
test_utilstest-utils
Utilities for testing datagram protocols without operating-system sockets.

Structs§

ConnectedUdpFramed
A unified Stream and Sink of frames over a connected UdpSocket.
DatagramCapabilities
UDP implementation and ancillary-I/O capabilities of a socket.
DatagramDemux
Splits the datagrams of one listening socket into an association per (local, peer) address pair, each served by its own service as a DemuxedSocket: the datagram counterpart of accepting connections.
DatagramGroup
Attachment point for a DatagramSocketGroup. Clones share its path bound.
DatagramGroupAttachment
Owns one registration. Cancellation removes it without closing other paths.
DatagramGroupSender
Each handle has its own underlying sender and therefore its own readiness registration.
DatagramMetadata
Metadata associated with one receive buffer.
DatagramSocketGroup
A socket fed directly by independent associations to one local address.
DatagramSocketGroupConfig
Bounds for a group of independently owned datagram paths.
DemuxConfig
Bounds of a DatagramDemux.
DemuxedSender
Sends a DemuxedSocket’s replies through its listening socket, to its peer only.
DemuxedSocket
One association of a DatagramDemux: the datagrams one peer sent to one local address, and replies to that peer only.
PrefixedDatagramSocket
A DatagramSocket that first yields the datagrams an inspection read ahead, in order and with their boundaries and metadata, and only then what inner receives.
RetainedDatagram
A datagram read before its socket was handed on, kept with its receive metadata.
SendDatagram
Borrowed description of one outgoing datagram or segmented datagram group.
SharedQueueBudget
A byte budget several DatagramDemuxes share, so that what they queue together stays within one bound, as a proxy serving many flows needs.
UdpFramed
A unified Stream and Sink interface to an underlying UdpSocket, using the Encoder and Decoder traits to encode and decode frames.
UdpPacketSender
Send handle for a UdpPacketSocket. Cloning gives another handle with its own readiness registration.
UdpPacketSocket
Packet-oriented Tokio UDP socket with portable ancillary metadata.
UdpSocketnet
A UDP socket.
UdpSocketConfig
Configuration shared by UDP packet-socket factories.
UdpSocketFactory
Rama service/factory for configured UdpPacketSocket instances.

Enums§

DatagramError
Error from a packet-oriented datagram operation.
DatagramFeature
Datagram feature that can be unavailable on a platform or socket provider.
EcnCodepoint
Explicit Congestion Notification codepoint from the low two IP traffic-class bits.
InvalidDatagramMetadata
Why a receive’s metadata does not describe a usable datagram.
ReceiveTimestamp
Receive time together with the clock domain used by its producer.
SendFailure
Coarse classification of a failed send.

Constants§

MAX_UDP_PAYLOAD_IPV4
Largest UDP payload representable by ordinary IPv4.
MAX_UDP_PAYLOAD_IPV6
Largest UDP payload representable by ordinary IPv6 without jumbograms.

Traits§

DatagramPeekInput
An input whose ingress datagrams an inspection may read ahead: a DatagramSocket itself, or the ingress side of a BridgeIo whose egress was already prepared.
DatagramSender
Independently wakeable send side of a DatagramSocket.
DatagramSenderExt
Async convenience methods for DatagramSender.
DatagramSocket
Receive side of an asynchronous packet-oriented datagram socket.
DatagramSocketExt
Async convenience methods for DatagramSocket.

Functions§

bind_udp_socket_with_connect
Bind a UdpSocket to the local interface and connect to the given IP host and port.
bind_udp_with_address
Creates a new UdpSocket, which will be bound to the specified address.
bind_udp_with_deviceAndroid or Fuchsia or Linux
Creates a new UdpSocket, which will be bound to the specified (interface) device name).
bind_udp_with_sockettarget_family=unix or Windows
Creates a new UdpSocket, which will be bound to the specified socket.
is_datagram_too_large
Whether error reports a datagram too large for the call: on send, for the path or socket; on a Windows receive, for the buffer, where Unix truncates instead.