-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tracking] streams #129
Comments
I've documented some things out here: https://paper.dropbox.com/doc/async-flow--AjJPPnPNL6eLfTQ3FT3Qew3zAQ-qCeBTk0Z0Nk92kn1ifNbQ It was open for comments. |
I would like to port map, filter and fold :). I like this function in std. I'm never seriously did any async with rust before. @vertexclique the link you posted is an example we should follow to implement all this functions ? |
I started with simple methods like @sepiropht you may take a look at my pr, and the |
Ok thanks @shekohex. I will try that |
@sepiropht from my point of view better to concentrate on |
Note that some features on this list are not useful until asynchronous closure is improved. |
@yoshuawuyts
https://doc.rust-lang.org/nightly/core/iter/fn.once_with.html
|
@taiki-e thanks, I've updated the issue! |
149: update deps r=stjepang a=yoshuawuyts Updates all deps. Thanks! 150: split stream into multiple files r=stjepang a=yoshuawuyts This splits `stream/mod.rs`'s combinators into multiple files, making it easier to contribute combinators. Additionally we've renamed `MinBy` to `MinByFuture` to make it the same as the other private futures. Ref #146 #129. Thanks! Co-authored-by: Yoshua Wuyts <[email protected]> Co-authored-by: Stjepan Glavina <[email protected]>
166: adds stream::nth combinator r=yoshuawuyts a=montekki Implements `nth` combinator. --- Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.nth Ref: #129 Co-authored-by: Fedor Sakharov <[email protected]>
163: adds stream::filter_map combinator r=yoshuawuyts a=montekki Implements a `flat_map` combinator. Currently the same about `ret!` as in #162 . Also the naming should probably be `FilterMapStream`, but in that case `Take` stream should also change it's name i guess. Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flat_map Ref: #129 Co-authored-by: Fedor Sakharov <[email protected]>
174: adds stream::find_map combinator r=yoshuawuyts a=montekki Adds a `stream::find_map` combinator --- Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find_map Ref: #129 Co-authored-by: Fedor Sakharov <[email protected]>
179: adds stream::find combinator r=yoshuawuyts a=montekki A find combinator --- Stdlib: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find Ref: #129 Co-authored-by: Fedor Sakharov <[email protected]>
177: implement DoubleEndedStream r=yoshuawuyts a=yoshuawuyts Ref #129. This is the most basic version of the `DoubleEndedStream` trait. Because there is no counterpart in `futures-rs` we allow this to be implementable (not sure if we should though?). This is not a high-priority trait to implement, with probably the most useful addition being the blanket impl over [`std::iter::Fuse`](https://doc.rust-lang.org/std/iter/struct.Fuse.html) (where we should have a `Fuse` counterpart for `Stream` also). So I'm taking this one step at the time, and this PR introduces just the bare minimum to get things working. Thanks! r? @stjepang @taiki-e ## Refs - https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html - #129 Co-authored-by: Yoshua Wuyts <[email protected]>
I would like to try the min-max-family. |
If they're not claimed yet, I'd like to do |
@ktomsic It's all yours, go ahead :) |
The Stream::rposition maybe need fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where
P: FnMut(Self::Item) -> bool,
Self: Sized + ExactSizeIterator + DoubleEndedIterator, So are the |
I've started to play with the Double ended iterators |
@yoshuawuyts I think we can cross of a bunch of things here, unless it only considers |
With #125 out, it's probably worth looking at which other parts of
std::iter
we can port toasync_std::stream
. This issue is intended to track what's left for us to port.Missing free functions
from_fn
repeat_with
successors
Missing traits
DoubleEndedStream
ExactSizeStream
Extend
FusedStream
Product
Sum
Missing stream methods
Stream::all
Stream::any
Stream::by_ref
Stream::chain
Stream::cloned
Stream::cmp
Stream::collect
Stream::copied
Stream::count
Stream::cycle
Stream::enumerate
Stream::eq
Stream::filter
Stream::filter_map
Stream::find
Stream::find_map
Stream::flat_map
Stream::flatten
Stream::fold
Stream::for_each
Stream::fuse
Stream::ge
Stream::gt
Stream::inspect
Stream::last
Stream::le
Stream::lt
Stream::map
Stream::max
Stream::max_by
Stream::max_by_key
Stream::min
Stream::min_by
Stream::min_by_key
Stream::ne
Stream::nth
Stream::partial_cmp
Stream::partition
Stream::peekable
-> wip add stream::peekable #366Stream::position
Stream::product
Stream::rev
Stream::rposition
Stream::scan
Stream::size_hint
Stream::skip
Stream::skip_while
Stream::step_by
Stream::sum
Stream::take
Stream::take_while
Stream::try_fold
Stream::try_for_each
Stream::unzip
Stream::zip
MissingIntoStream
implsCurrently not possible. See #129 (comment)
Missing
FromStream
implsFromStream<()> for ()
FromStream<char> for String
FromStream<String> for String
FromStream<&'a char> for String
FromStream<&'a str> for String
FromStream<T> for Cow<'a, [T]> where T: Clone
FromStream<A> for Box<[A]>
FromStream<A> for VecDeque<A>
FromStream<Result<A, E>> for Result<V, E> where V: FromStream<A>
FromStream<Option<A>> for Option<V> where V: FromStream<A>
FromStream<(K, V)> for BTreeMap<K, V> where K: Ord
FromStream<(K, V)> for HashMap<K, V, S> where K: Eq + Hash, S: BuildHasher + Default
FromStream<T> for BinaryHeap<T> where T: Ord
FromStream<T> for BTreeSet<T> where T: Ord
FromStream<T> for LinkedList<T>
FromStream<T> for Vec<T>
FromStream<T> for HashSet<T, S> where T: Eq + Hash, S: BuildHasher + Default
DoubleEndedStream
DoubleEndedStream::poll_next_back
DoubleEndedStream::next_back
DoubleEndedStream::nth_back
DoubleEndedStream::rfind
DoubleEndedStream::rfold
DoubleEndedStream::try_rfold
The text was updated successfully, but these errors were encountered: