From ae587fc221a638d223b450a4a353328838f92c10 Mon Sep 17 00:00:00 2001 From: Will Bicks Date: Tue, 26 Nov 2024 11:39:08 -0500 Subject: [PATCH] docs: Improve UdpMetadata doc comments. Fix local_address doc to indicate purpose on outgoing datagrams. Add rustdoc comment to endpoint field. --- src/socket/udp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/socket/udp.rs b/src/socket/udp.rs index 1e09116f3..b1a843904 100644 --- a/src/socket/udp.rs +++ b/src/socket/udp.rs @@ -14,8 +14,10 @@ use crate::wire::{IpAddress, IpEndpoint, IpListenEndpoint, IpProtocol, IpRepr, U #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub struct UdpMetadata { + /// The IP endpoint from which an incoming datagram was received, or to which an outgoing + /// datagram will be sent. pub endpoint: IpEndpoint, - /// The IP address to which an incoming datagram was sent, or to which an outgoing datagram + /// The IP address to which an incoming datagram was sent, or from which an outgoing datagram /// will be sent. Incoming datagrams always have this set. On outgoing datagrams, if it is not /// set, and the socket is not bound to a single address anyway, a suitable address will be /// determined using the algorithms of RFC 6724 (candidate source address selection) or some