Clarify StreamExt::timeout() docs

Open Beginner friendly
#800 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
documentation

Research direction

Start with the linked StreamExt::timeout() documentation and compare it with the timeout_repeat() behavior described in pull request #732. Clarify in both function descriptions whether the duration starts when timeout() is called or after the last stream item, then verify that the wording distinguishes the two behaviors.

Written by the indexing model from the issue text.

Description

documentation

The description for StreamExt::timeout() states it will "await a stream or times out after a duration of time," but it's not clear whether it times out after the specified duration

  1. since calling timeout()

or

  1. since a stream item was last produced

I wanted #2 when I used this function, but then I realized it actually works like #1.

I noticed theres a pull request that adds a timeout_repeat() function that implements #2; the docs on both these functions should make it clear which of the above behaviors it implements.

Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from async-rs/async-std

All issues in async-rs/async-std

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.