We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9357c0 commit f53fcbbCopy full SHA for f53fcbb
src/stream/pending.rs
@@ -18,6 +18,27 @@ pub struct Pending<T> {
18
/// Creates a stream that never returns any items.
19
///
20
/// The returned stream will always return `Pending` when polled.
21
+/// # Examples
22
+///
23
+/// ```
24
+/// # async_std::task::block_on(async {
25
+/// #
26
+/// use std::time::Duration;
27
28
+/// use async_std::prelude::*;
29
+/// use async_std::stream;
30
31
+/// let dur = Duration::from_millis(100);
32
+/// let mut s = stream::pending::<()>().timeout(dur);
33
34
+/// let item = s.next().await;
35
36
+/// assert!(item.is_some());
37
+/// assert!(item.unwrap().is_err());
38
39
40
+/// # })
41
42
pub fn pending<T>() -> Pending<T> {
43
Pending {
44
_marker: PhantomData,
0 commit comments