File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ impl UdpSocket {
100
100
///
101
101
/// Note that this call does not perform any actual network communication,
102
102
/// because UDP is a datagram protocol.
103
+ #[ deprecated = "`UdpStream` has been deprecated" ]
104
+ #[ allow( deprecated) ]
103
105
pub fn connect ( self , other : SocketAddr ) -> UdpStream {
104
106
UdpStream {
105
107
socket : self ,
@@ -205,6 +207,14 @@ impl Clone for UdpSocket {
205
207
206
208
/// A type that allows convenient usage of a UDP stream connected to one
207
209
/// 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]
208
218
pub struct UdpStream {
209
219
socket : UdpSocket ,
210
220
connected_to : SocketAddr
@@ -336,6 +346,7 @@ mod test {
336
346
}
337
347
338
348
#[ test]
349
+ #[ allow( deprecated) ]
339
350
fn stream_smoke_test_ip4 ( ) {
340
351
let server_ip = next_test_ip4 ( ) ;
341
352
let client_ip = next_test_ip4 ( ) ;
@@ -380,6 +391,7 @@ mod test {
380
391
}
381
392
382
393
#[ test]
394
+ #[ allow( deprecated) ]
383
395
fn stream_smoke_test_ip6 ( ) {
384
396
let server_ip = next_test_ip6 ( ) ;
385
397
let client_ip = next_test_ip6 ( ) ;
You can’t perform that action at this time.
0 commit comments