Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions library/std/src/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ impl UdpSocket {
/// hold the message bytes. If a message is too long to fit in the supplied buffer,
/// excess bytes may be discarded.
///
/// Refer to the platform-specific documentation on this function; it is considered
/// correct for its behavior to differ from [`UdpSocket::recv`] if the underlying system
/// call does so.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds fine, but we don't tell people what this does under the hood, so I'm not sure they can refer to platform-specific documentation easily. Maybe we can add a section on what the underlying libc/syscall made is (with a link to https://doc.rust-lang.org/nightly/std/io/index.html#platform-specific-behavior)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this in the libs-api meeting; we intentionally don't guarantee this right now, but most platforms have an "obvious" choice (e.g. recvfrom on linux)

///
/// # Examples
///
/// ```no_run
Expand Down Expand Up @@ -711,6 +715,10 @@ impl UdpSocket {
/// [`UdpSocket::connect`] will connect this socket to a remote address. This
/// method will fail if the socket is not connected.
///
/// Refer to the platform-specific documentation on this function; it is considered
/// correct for its behavior to differ from [`UdpSocket::recv_from`] if the underlying
/// system call does so.
///
/// # Examples
///
/// ```no_run
Expand Down
Loading