How implement an iterator over a growing collection?

· Users Rust Lang · Aug. 30, 2026, 3:24 a.m.
Summary
This blog post discusses implementing an iterator over a growing collection in Rust, detailing a custom iterator struct and the challenges of modifying the collection during iteration. It presents code snippets and outlines common errors encountered, particularly regarding ownership and borrowing in Rust. The author seeks advice on resolving the issue while using the iterator, inviting input from the community.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →