Lines Matching refs:tx

29     let (tx, mut rx) = unbounded_channel();
35 assert!(tx.send(1).is_ok());
36 assert!(tx.send(2).is_ok());
37 drop(tx);
49 let (tx, mut rx) = unbounded_channel();
54 assert!(tx.send(1).is_ok());
55 assert!(tx.send(2).is_ok());
56 drop(tx);
68 let (tx, mut rx) = unbounded_channel();
70 assert!(tx.send(1).is_ok());
72 drop(tx);
84 let (tx, mut rx) = unbounded_channel();
86 assert!(tx.send(1).is_ok());
104 let (tx, mut rx) = bounded_channel::<i32>(1);
112 assert!(tx.send(1).await.is_ok());
113 assert!(tx.send(2).await.is_ok());
126 let (tx, mut rx) = bounded_channel::<i32>(3);
133 assert!(tx.send(1).await.is_ok());
134 assert!(tx.send(2).await.is_ok());
149 let (tx, mut rx) = bounded_channel::<i32>(1);
151 assert!(tx.try_send(1).is_ok());
152 assert_eq!(tx.try_send(2), Err(TrySendError::Full(2)));
154 drop(tx);
168 let (tx, mut rx) = bounded_channel(1);
170 assert!(tx.send_timeout(1, Duration::from_millis(10)).await.is_ok());
171 assert!(tx.send_timeout(2, Duration::from_millis(10)).await.is_err());
192 let (tx, rx) = unbounded_channel::<i32>();
193 assert!(!tx.is_closed());
195 assert!(tx.is_closed());
196 assert!(tx.send(1).is_err());
198 let (tx, rx) = bounded_channel::<i32>(1);
199 assert!(!tx.is_closed());
201 assert!(tx.is_closed());
202 assert!(tx.try_send(1).is_err());
214 let (tx, _) = unbounded_channel::<i32>();
217 assert!(!tx.is_same(&tx2));
218 assert!(tx.is_same(&tx));
220 let (tx, _) = bounded_channel::<i32>(1);
223 assert!(!tx.is_same(&tx2));
224 assert!(tx.is_same(&tx));
236 let (tx, mut rx) = unbounded_channel();
238 let _ = tx.send(i);
250 let (tx, mut rx) = bounded_channel(10);
252 let _ = tx.try_send(i);
276 let (tx, mut rx) = unbounded_channel();
279 let tx2 = tx.clone();
296 let (tx, mut rx) = bounded_channel(10);
299 let tx2 = tx.clone();