///
/// fn main() -> std::io::Result<()> {
/// {
-/// let mut socket = UdpSocket::bind("127.0.0.1:34254")?;
+/// let socket = UdpSocket::bind("127.0.0.1:34254")?;
///
/// // Receives a single datagram message on the socket. If `buf` is too small to hold
/// // the message, it will be cut off.
/// Sets the value of the `IP_MULTICAST_LOOP` option for this socket.
///
/// If enabled, multicast packets will be looped back to the local socket.
- /// Note that this may not have any effect on IPv6 sockets.
+ /// Note that this might not have any effect on IPv6 sockets.
///
/// # Examples
///
/// this socket. The default value is 1 which means that multicast packets
/// don't leave the local network unless explicitly requested.
///
- /// Note that this may not have any effect on IPv6 sockets.
+ /// Note that this might not have any effect on IPv6 sockets.
///
/// # Examples
///
/// Sets the value of the `IPV6_MULTICAST_LOOP` option for this socket.
///
/// Controls whether this socket sees the multicast packets it sends itself.
- /// Note that this may not have any affect on IPv4 sockets.
+ /// Note that this might not have any affect on IPv4 sockets.
///
/// # Examples
///
}
}
+// In addition to the `impl`s here, `UdpSocket` also has `impl`s for
+// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
+// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
+// `AsSocket`/`From<OwnedSocket>`/`Into<OwnedSocket>` and
+// `AsRawSocket`/`IntoRawSocket`/`FromRawSocket` on Windows.
+
impl AsInner<net_imp::UdpSocket> for UdpSocket {
fn as_inner(&self) -> &net_imp::UdpSocket {
&self.0