Skip to content

Commit b961310

Browse files
author
Julian Orth
committed
---
yaml --- r: 157053 b: refs/heads/try c: d6dc01e h: refs/heads/master i: 157051: e45298d v: v3
1 parent 111716b commit b961310

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 2d27bfaeb6522d386d0a2735cb3f75cc5707314a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
5-
refs/heads/try: 8adfd02368343636fe83b68e35c3b8e2db0f0e02
5+
refs/heads/try: d6dc01e7974bc6dc77b50563bd690c839eb66656
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75

branches/try/src/libstd/io/net/udp.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ impl UdpSocket {
100100
///
101101
/// Note that this call does not perform any actual network communication,
102102
/// because UDP is a datagram protocol.
103+
#[deprecated = "`UdpStream` has been deprecated"]
104+
#[allow(deprecated)]
103105
pub fn connect(self, other: SocketAddr) -> UdpStream {
104106
UdpStream {
105107
socket: self,
@@ -205,6 +207,14 @@ impl Clone for UdpSocket {
205207

206208
/// A type that allows convenient usage of a UDP stream connected to one
207209
/// address via the `Reader` and `Writer` traits.
210+
///
211+
/// # Note
212+
///
213+
/// This structure has been deprecated because `Reader` is a stream-oriented API but UDP
214+
/// is a packet-oriented protocol. Every `Reader` method will read a whole packet and
215+
/// throw all superfluous bytes away so that they are no longer available for further
216+
/// method calls.
217+
#[deprecated]
208218
pub struct UdpStream {
209219
socket: UdpSocket,
210220
connected_to: SocketAddr
@@ -336,6 +346,7 @@ mod test {
336346
}
337347

338348
#[test]
349+
#[allow(deprecated)]
339350
fn stream_smoke_test_ip4() {
340351
let server_ip = next_test_ip4();
341352
let client_ip = next_test_ip4();
@@ -380,6 +391,7 @@ mod test {
380391
}
381392

382393
#[test]
394+
#[allow(deprecated)]
383395
fn stream_smoke_test_ip6() {
384396
let server_ip = next_test_ip6();
385397
let client_ip = next_test_ip6();

0 commit comments

Comments
 (0)