Closed dan-da closed 8 months ago
key/val pairs
It looks like you have opened an issue in the wrong repository.
This repository does not contain any map-like structures.
no, not the wrong repo. The key/val pairs are returned in a tuple, ie impl Stream<Item = (Index, T)>
and the method impl uses the async_stream::stream
macro to yield
the tuple. I only mentioned it to say thx for creating the crate.
Anyway, that is irrelevant to the question, which is about if there is any way to return an async iterator from a collection's method that can mutate the collection.
if there is any way to return an async iterator from a collection's method that can mutate the collection.
If the collection has a method that returns a stream, it can be used. Otherwise, I believe you can combine futures::stream::iter with a method that returns an iterator.
Hi, thx for this crate. I was able to easily create an async method stream_many() that accepts an impl IntoIter of indexes and returns an impl Stream of key/val pairs for only those indices. pretty cool.
Next I was wondering if there is any way I can write a method that returns a Stream that can mutate
&mut self
? eg:Perhaps with some kind of lending iterator?
or any plans in this area?