#iterator #data-structures

estimate_size

Replaces an iterator’s size_hint with a custom value

3 releases

Uses new Rust 2024

0.1.2 Sep 14, 2025
0.1.1 Sep 13, 2025
0.1.0 Sep 13, 2025

#1523 in Rust patterns

27 downloads per month

MIT license

8KB
136 lines

estimate_size Crates.io Version

A library used on iterators which allows adapting a custom size_hint with your estimate, for iterators that do not provide accurate estimates themselves.

Usage

use estimate_size::EstimateSize;
(0..10).filter(|x| x % 2 == 0).estimate_exact_size(5)

No runtime deps