[GH-ISSUE #1866] Iterator size hints #797

Open
opened 2026-03-16 00:17:13 +03:00 by kerem · 6 comments
Owner

Originally created by @mattfbacon on GitHub (Dec 22, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1866

This crate includes some iterators. It would be nice if those iterators had proper size hints.

Originally created by @mattfbacon on GitHub (Dec 22, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1866 This crate includes some iterators. It would be nice if those iterators had proper size hints.
Author
Owner

@djc commented on GitHub (Dec 22, 2022):

Pull requests welcome!

<!-- gh-comment-id:1362559354 --> @djc commented on GitHub (Dec 22, 2022): Pull requests welcome!
Author
Owner

@mattfbacon commented on GitHub (Dec 30, 2022):

OK, I will look into it

<!-- gh-comment-id:1368095910 --> @mattfbacon commented on GitHub (Dec 30, 2022): OK, I will look into it
Author
Owner

@mattfbacon commented on GitHub (Dec 30, 2022):

I'm looking at the RrsigsByAlgorithms iterator implementation, specifically this part:

github.com/bluejekyll/trust-dns@249fb26608/crates/proto/src/rr/rr_set.rs (L560-L576)

What is this meant to do? As far as I can tell it will yield one item at most.

<!-- gh-comment-id:1368105329 --> @mattfbacon commented on GitHub (Dec 30, 2022): I'm looking at the RrsigsByAlgorithms iterator implementation, specifically this part: https://github.com/bluejekyll/trust-dns/blob/249fb266089b6205e461dfff05d7fc40e92d22bb/crates/proto/src/rr/rr_set.rs#L560-L576 What is this meant to do? As far as I can tell it will yield one item at most.
Author
Owner

@bluejekyll commented on GitHub (Dec 31, 2022):

This creates an iterator limiting the RRSIG responses to hash algorithms the client understands and then reduces that to the strongest algorithm understood. That only happens if the client sends supported algorithms, otherwise it sends them all.

<!-- gh-comment-id:1368152358 --> @bluejekyll commented on GitHub (Dec 31, 2022): This creates an iterator limiting the RRSIG responses to hash algorithms the client understands and then reduces that to the strongest algorithm understood. That only happens if the client sends supported algorithms, otherwise it sends them all.
Author
Owner

@mattfbacon commented on GitHub (Dec 31, 2022):

Ok so it will just yield 0 or 1 items in that case

<!-- gh-comment-id:1368153218 --> @mattfbacon commented on GitHub (Dec 31, 2022): Ok so it will just yield 0 or 1 items in that case
Author
Owner

@bluejekyll commented on GitHub (Dec 31, 2022):

Well, 0, 1 or the number of RRSIGs by Algorithms (up to something like 4 or 5).

<!-- gh-comment-id:1368263372 --> @bluejekyll commented on GitHub (Dec 31, 2022): Well, 0, 1 or the number of RRSIGs by Algorithms (up to something like 4 or 5).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#797
No description provided.