summaryrefslogtreecommitdiffstats
path: root/tokio/src/net/udp
diff options
context:
space:
mode:
authorZahari Dichev <zaharidichev@gmail.com>2020-10-24 15:26:01 +0300
committerGitHub <noreply@github.com>2020-10-24 14:26:01 +0200
commitce173fdc918c5934561560a97d366fce6edb36d0 (patch)
treeb02982334d44d76b405441b4c95c1fe6e7deb830 /tokio/src/net/udp
parente804f88d60071f0d89db85aaa4a073857904b545 (diff)
docs: update docs for `from_std` functions (#3016)
Fixes: #3007
Diffstat (limited to 'tokio/src/net/udp')
-rw-r--r--tokio/src/net/udp/socket.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/tokio/src/net/udp/socket.rs b/tokio/src/net/udp/socket.rs
index beb2252c..55f26110 100644
--- a/tokio/src/net/udp/socket.rs
+++ b/tokio/src/net/udp/socket.rs
@@ -158,11 +158,12 @@ impl UdpSocket {
Ok(UdpSocket { io })
}
- /// Creates a new `UdpSocket` from the previously bound socket provided.
+ /// Creates new `UdpSocket` from a previously bound `std::net::UdpSocket`.
///
- /// The socket given will be registered with the event loop that `handle`
- /// is associated with. This function requires that `socket` has previously
- /// been bound to an address to work correctly.
+ /// This function is intended to be used to wrap a UDP socket from the
+ /// standard library in the Tokio equivalent. The conversion assumes nothing
+ /// about the underlying socket; it is left up to the user to set it in
+ /// non-blocking mode.
///
/// This can be used in conjunction with net2's `UdpBuilder` interface to
/// configure a socket before it's handed off, such as setting options like