diff options
| author | Julian Orth <ju.orth@gmail.com> | 2014-10-18 01:36:46 +0200 |
|---|---|---|
| committer | Julian Orth <ju.orth@gmail.com> | 2014-10-25 09:11:47 +0200 |
| commit | d6dc01e7974bc6dc77b50563bd690c839eb66656 (patch) | |
| tree | 54b523b53fff370af31ad8869534c6c9b794cba0 /src/libstd | |
| parent | 8adfd02368343636fe83b68e35c3b8e2db0f0e02 (diff) | |
| download | rust-d6dc01e7974bc6dc77b50563bd690c839eb66656.tar.gz rust-d6dc01e7974bc6dc77b50563bd690c839eb66656.zip | |
Deprecate UdpStream
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/net/udp.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index 651cb9f596d..7d9eea3a732 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -100,6 +100,8 @@ impl UdpSocket { /// /// Note that this call does not perform any actual network communication, /// because UDP is a datagram protocol. + #[deprecated = "`UdpStream` has been deprecated"] + #[allow(deprecated)] pub fn connect(self, other: SocketAddr) -> UdpStream { UdpStream { socket: self, @@ -205,6 +207,14 @@ impl Clone for UdpSocket { /// A type that allows convenient usage of a UDP stream connected to one /// address via the `Reader` and `Writer` traits. +/// +/// # Note +/// +/// This structure has been deprecated because `Reader` is a stream-oriented API but UDP +/// is a packet-oriented protocol. Every `Reader` method will read a whole packet and +/// throw all superfluous bytes away so that they are no longer available for further +/// method calls. +#[deprecated] pub struct UdpStream { socket: UdpSocket, connected_to: SocketAddr @@ -336,6 +346,7 @@ mod test { } #[test] + #[allow(deprecated)] fn stream_smoke_test_ip4() { let server_ip = next_test_ip4(); let client_ip = next_test_ip4(); @@ -380,6 +391,7 @@ mod test { } #[test] + #[allow(deprecated)] fn stream_smoke_test_ip6() { let server_ip = next_test_ip6(); let client_ip = next_test_ip6(); |
