mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
update Stream::fuse docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
parent
4ecf49fe95
commit
b3ae6f2b03
2 changed files with 6 additions and 5 deletions
|
@ -6,8 +6,7 @@ use crate::stream::Stream;
|
||||||
use crate::task::{Context, Poll};
|
use crate::task::{Context, Poll};
|
||||||
|
|
||||||
pin_project! {
|
pin_project! {
|
||||||
/// A `Stream` that is permanently closed once a single call to `poll` results in
|
/// A stream that yields `None` forever after the underlying stream yields `None` once.
|
||||||
/// `Poll::Ready(None)`, returning `Poll::Ready(None)` for all future calls to `poll`.
|
|
||||||
///
|
///
|
||||||
/// This `struct` is created by the [`fuse`] method on [`Stream`]. See its
|
/// This `struct` is created by the [`fuse`] method on [`Stream`]. See its
|
||||||
/// documentation for more.
|
/// documentation for more.
|
||||||
|
|
|
@ -501,9 +501,11 @@ extension_trait! {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = r#"
|
#[doc = r#"
|
||||||
Transforms this `Stream` into a "fused" `Stream` such that after the first time
|
Creates a stream which ends after the first `None`.
|
||||||
`poll` returns `Poll::Ready(None)`, all future calls to `poll` will also return
|
|
||||||
`Poll::Ready(None)`.
|
After a stream returns `None`, future calls may or may not yield `Some(T)` again.
|
||||||
|
`fuse()` adapts an iterator, ensuring that after a `None` is given, it will always
|
||||||
|
return `None` forever.
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue