Skip to content

Document fusing and other iterator protocol details #55

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

Open
bluss opened this issue Sep 4, 2015 · 0 comments
Open

Document fusing and other iterator protocol details #55

bluss opened this issue Sep 4, 2015 · 0 comments

Comments

@bluss
Copy link
Member

bluss commented Sep 4, 2015

  • Adaptor is fused: guaranteed to return None indefinitely after end of iterator.
  • Adaptor is well behaved: Does not call .next() on non-fused iterator after it has returned None once.

All of our adaptors must be well behaved, some guarantee being fused.

bors bot added a commit that referenced this issue Jun 8, 2021
550: Add More FusedIterator r=jswrenn a=aobatact

These Iterator is fused if the underlying Iterator is fused.
-  `FilterOk`
-  `FilterMapOk`
- `InterleaveShortest`
- `KMergeBy`
- `MergeBy`
- `PadUsing`
- `Positions`
- `Product` 
- `RcIter`
- `TupleWindows`
- `Unique`
- `UniqueBy`
-  `Update`
- `WhileSome`

These is fused even though the underlying Iterator is not fused.
- `Combinations` 
- `CombinationsWithReplacement`
- `Powerset`
- `RepeatN`
- `WithPosition` 

`FusedIterator` can be added to these structs.

Related  #55, #152, #531, #533

I separate the pull request with #548 because these Iterator are sure to be fused because it was documented, but I'm not 100% sure that the structs in this PR is actually fused. (Though I believe it is.)

Co-authored-by: aobatact <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant