1
+ #![ allow( deprecated) ]
2
+
1
3
use std:: cell:: UnsafeCell ;
2
4
use std:: error:: Error ;
3
5
use std:: fmt:: { self , Debug , Display } ;
@@ -32,6 +34,7 @@ use crate::sync::WakerSet;
32
34
/// # Examples
33
35
///
34
36
/// ```
37
+ /// #![allow(deprecated)]
35
38
/// # fn main() -> Result<(), async_std::sync::RecvError> {
36
39
/// # async_std::task::block_on(async {
37
40
/// #
@@ -60,6 +63,7 @@ use crate::sync::WakerSet;
60
63
/// ```
61
64
#[ cfg( feature = "unstable" ) ]
62
65
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
66
+ #[ deprecated = "new channel api at async_std::channel" ]
63
67
pub fn channel < T > ( cap : usize ) -> ( Sender < T > , Receiver < T > ) {
64
68
let channel = Arc :: new ( Channel :: with_capacity ( cap) ) ;
65
69
let s = Sender {
@@ -82,6 +86,7 @@ pub fn channel<T>(cap: usize) -> (Sender<T>, Receiver<T>) {
82
86
/// # Examples
83
87
///
84
88
/// ```
89
+ /// #![allow(deprecated)]
85
90
/// # async_std::task::block_on(async {
86
91
/// #
87
92
/// use async_std::sync::channel;
@@ -102,6 +107,7 @@ pub fn channel<T>(cap: usize) -> (Sender<T>, Receiver<T>) {
102
107
/// ```
103
108
#[ cfg( feature = "unstable" ) ]
104
109
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
110
+ #[ deprecated = "new channel api at async_std::channel" ]
105
111
pub struct Sender < T > {
106
112
/// The inner channel.
107
113
channel : Arc < Channel < T > > ,
@@ -115,6 +121,7 @@ impl<T> Sender<T> {
115
121
/// # Examples
116
122
///
117
123
/// ```
124
+ /// #![allow(deprecated)]
118
125
/// # fn main() -> Result<(), async_std::sync::RecvError> {
119
126
/// # async_std::task::block_on(async {
120
127
/// #
@@ -204,6 +211,7 @@ impl<T> Sender<T> {
204
211
/// # Examples
205
212
///
206
213
/// ```
214
+ /// #![allow(deprecated)]
207
215
/// # async_std::task::block_on(async {
208
216
/// #
209
217
/// use async_std::sync::channel;
@@ -223,6 +231,7 @@ impl<T> Sender<T> {
223
231
/// # Examples
224
232
///
225
233
/// ```
234
+ /// #![allow(deprecated)]
226
235
/// use async_std::sync::channel;
227
236
///
228
237
/// let (s, _) = channel::<i32>(5);
@@ -237,6 +246,7 @@ impl<T> Sender<T> {
237
246
/// # Examples
238
247
///
239
248
/// ```
249
+ /// #![allow(deprecated)]
240
250
/// # async_std::task::block_on(async {
241
251
/// #
242
252
/// use async_std::sync::channel;
@@ -258,6 +268,7 @@ impl<T> Sender<T> {
258
268
/// # Examples
259
269
///
260
270
/// ```
271
+ /// #![allow(deprecated)]
261
272
/// # async_std::task::block_on(async {
262
273
/// #
263
274
/// use async_std::sync::channel;
@@ -279,6 +290,7 @@ impl<T> Sender<T> {
279
290
/// # Examples
280
291
///
281
292
/// ```
293
+ /// #![allow(deprecated)]
282
294
/// # async_std::task::block_on(async {
283
295
/// #
284
296
/// use async_std::sync::channel;
@@ -339,6 +351,7 @@ impl<T> fmt::Debug for Sender<T> {
339
351
/// # Examples
340
352
///
341
353
/// ```
354
+ /// #![allow(deprecated)]
342
355
/// # fn main() -> Result<(), async_std::sync::RecvError> {
343
356
/// # async_std::task::block_on(async {
344
357
/// #
@@ -363,6 +376,7 @@ impl<T> fmt::Debug for Sender<T> {
363
376
/// ```
364
377
#[ cfg( feature = "unstable" ) ]
365
378
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
379
+ #[ deprecated = "new channel api at async_std::channel" ]
366
380
pub struct Receiver < T > {
367
381
/// The inner channel.
368
382
channel : Arc < Channel < T > > ,
@@ -381,6 +395,7 @@ impl<T> Receiver<T> {
381
395
/// # Examples
382
396
///
383
397
/// ```
398
+ /// #![allow(deprecated)]
384
399
/// # fn main() -> Result<(), async_std::sync::RecvError> {
385
400
/// # async_std::task::block_on(async {
386
401
/// #
@@ -444,6 +459,7 @@ impl<T> Receiver<T> {
444
459
/// # Examples
445
460
///
446
461
/// ```
462
+ /// #![allow(deprecated)]
447
463
/// # async_std::task::block_on(async {
448
464
/// #
449
465
/// use async_std::sync::channel;
@@ -466,6 +482,7 @@ impl<T> Receiver<T> {
466
482
/// # Examples
467
483
///
468
484
/// ```
485
+ /// #![allow(deprecated)]
469
486
/// use async_std::sync::channel;
470
487
///
471
488
/// let (_, r) = channel::<i32>(5);
@@ -480,6 +497,7 @@ impl<T> Receiver<T> {
480
497
/// # Examples
481
498
///
482
499
/// ```
500
+ /// #![allow(deprecated)]
483
501
/// # async_std::task::block_on(async {
484
502
/// #
485
503
/// use async_std::sync::channel;
@@ -501,6 +519,7 @@ impl<T> Receiver<T> {
501
519
/// # Examples
502
520
///
503
521
/// ```
522
+ /// #![allow(deprecated)]
504
523
/// # async_std::task::block_on(async {
505
524
/// #
506
525
/// use async_std::sync::channel;
@@ -522,6 +541,7 @@ impl<T> Receiver<T> {
522
541
/// # Examples
523
542
///
524
543
/// ```
544
+ /// #![allow(deprecated)]
525
545
/// # async_std::task::block_on(async {
526
546
/// #
527
547
/// use async_std::sync::channel;
@@ -993,6 +1013,7 @@ impl<T> Drop for Channel<T> {
993
1013
#[ cfg( feature = "unstable" ) ]
994
1014
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
995
1015
#[ derive( PartialEq , Eq ) ]
1016
+ #[ deprecated = "new channel api at async_std::channel" ]
996
1017
pub enum TrySendError < T > {
997
1018
/// The channel is full but not disconnected.
998
1019
Full ( T ) ,
@@ -1025,6 +1046,7 @@ impl<T> Display for TrySendError<T> {
1025
1046
#[ cfg( feature = "unstable" ) ]
1026
1047
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
1027
1048
#[ derive( Debug , PartialEq , Eq ) ]
1049
+ #[ deprecated = "new channel api at async_std::channel" ]
1028
1050
pub enum TryRecvError {
1029
1051
/// The channel is empty but not disconnected.
1030
1052
Empty ,
@@ -1048,6 +1070,7 @@ impl Display for TryRecvError {
1048
1070
#[ cfg( feature = "unstable" ) ]
1049
1071
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
1050
1072
#[ derive( Debug , PartialEq , Eq ) ]
1073
+ #[ deprecated = "new channel api at async_std::channel" ]
1051
1074
pub struct RecvError ;
1052
1075
1053
1076
impl Error for RecvError { }
0 commit comments