async-rs / async-rs/async-std

[tracking] streams

Open
#129 29 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

With #125 out, it's probably worth looking at which other parts of [`std::iter`](https://doc.rust-lang.org/std/iter/index.html) we can port to [`async_std::stream`](https://docs.rs/async-std/0.99.4/async_std/stream/index.html). This issue is intended to track what's left for us to port.

## Missing free functions
- [x] `from_fn`
- [x] `repeat_with`
- [x] `successors`

## Missing traits
- [x] `DoubleEndedStream`
- [x] `ExactSizeStream`
- [x] `Extend`
- [x] `FusedStream`
- [x] `Product`
- [x] `Sum`

## Missing stream methods
- [x] `Stream::all`
- [x] `Stream::any`
- [x] `Stream::by_ref`
- [x] `Stream::chain`
- [x] `Stream::cloned`
- [x] `Stream::cmp`
- [x] `Stream::collect`
- [x] `Stream::copied`
- [x] `Stream::count`
- [x] `Stream::cycle`
- [x] `Stream::enumerate`
- [x] `Stream::eq`
- [x] `Stream::filter`
- [x] `Stream::filter_map`
- [x] `Stream::find`
- [x] `Stream::find_map`
- [x] `Stream::flat_map`
- [x] `Stream::flatten`
- [x] `Stream::fold`
- [x] `Stream::for_each`
- [x] `Stream::fuse`
- [x] `Stream::ge`
- [x] `Stream::gt`
- [x] `Stream::inspect`
- [x] `Stream::last`
- [x] `Stream::le`
- [x] `Stream::lt`
- [x] `Stream::map`
- [x] `Stream::max`
- [x] `Stream::max_by`
- [x] `Stream::max_by_key`
- [x] `Stream::min`
- [x] `Stream::min_by`
- [x] `Stream::min_by_key`
- [x] `Stream::ne`
- [x] `Stream::nth`
- [x] `Stream::partial_cmp`
- [x] `Stream::partition`
- [ ] `Stream::peekable` -> wip https://github.com/async-rs/async-std/pull/366
- [x] `Stream::position`
- [x] `Stream::product`
- [ ] `Stream::rev`
- [ ] `Stream::rposition`
- [x] `Stream::scan`
- [x] `Stream::size_hint`
- [x] `Stream::skip`
- [x] `Stream::skip_while`
- [x] `Stream::step_by`
- [x] `Stream::sum`
- [x] `Stream::take`
- [x] `Stream::take_while`
- [x] `Stream::try_fold`
- [x] `Stream::try_for_each`
- [x] `Stream::unzip`
- [x] `Stream::zip`

## ~~Missing `IntoStream` impls~~
_Currently not possible. See https://github.com/async-rs/async-std/issues/129#issuecomment-533093186_

## Missing `FromStream` impls
- [x] `FromStream<()> for ()`
- [x] `FromStream for String`
- [x] `FromStream for String`
- [x] `FromStream<&'a char> for String`
- [x] `FromStream<&'a str> for String`
- [x] `FromStream for Cow<'a, [T]> where T: Clone`
- [x] `FromStream for Box<[A]>`
- [x] `FromStream
for VecDeque`
- [x] `FromStream> for Result where V: FromStream
`
- [x] `FromStream> for Option where V: FromStream
`
- [x] `FromStream<(K, V)> for BTreeMap where K: Ord`
- [x] `FromStream<(K, V)> for HashMap where K: Eq + Hash, S: BuildHasher + Default`
- [x] `FromStream for BinaryHeap where T: Ord`
- [x] `FromStream for BTreeSet where T: Ord`
- [x] `FromStream for LinkedList`
- [x] `FromStream for Vec`
- [x] `FromStream for HashSet where T: Eq + Hash, S: BuildHasher + Default`

## `DoubleEndedStream`
- [x] `DoubleEndedStream::poll_next_back`
- [x] `DoubleEndedStream::next_back`
- [x] `DoubleEndedStream::nth_back`
- [x] `DoubleEndedStream::rfind`
- [x] `DoubleEndedStream::rfold`
- [x] `DoubleEndedStream::try_rfold`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.