-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
C-tracking-issueCategory: A tracking issue for a feature request, i.e: not implemented / a PR.Category: A tracking issue for a feature request, i.e: not implemented / a PR.
Description
This is a tracking issue for asynchronous version of Iterator and the Stream object.
Public API
the two core interfaces are AsyncIterator which is the core, heart and soul. the trait itself, and Stream, Which is a basic general-purpose impl of an async iterator.
@rustc_diagnostic_item("async_iterator")
class AsyncIterator[Item](ABC):
async def poll_next(self) -> Option[Item]: ...
@abstractmethod
async def __anext__(self) -> Item: ...
def __aiter__(self) -> Self: ...
async def __await__(self) -> MutableSequence[Item]: ...
type Poller[T] = AsyncIterable[T] | Iterable[T]
@final
class Stream[T](AsyncIterator[T]):
def __init__(self, it: Poller[T]) -> None: ...
# impl AsyncIterator
# turns any iterable into a stream.
def into_stream[T](it: Poller[T]) -> Stream[T]: ...Steps / History
- Implementation: Add
AsyncIteratorandStream#258 - Adjusted documentation: 3c14240
- Tested: 3d1dbc4
- Changelog added: 3d1dbc4
Unresolved Questions
- should we impl every, single adapter that
Iteratorprovides?
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: A tracking issue for a feature request, i.e: not implemented / a PR.Category: A tracking issue for a feature request, i.e: not implemented / a PR.