#iterator #exhaustive #testing #brute-force #values #enums #iteration

no-std exhaust

Trait and derive macro for working with all possible values of a type (exhaustive enumeration)

5 releases

0.2.1 Sep 26, 2024
0.2.0 Sep 19, 2024
0.1.2 Sep 18, 2024
0.1.1 Apr 10, 2023
0.1.0 Feb 15, 2022

#376 in Rust patterns

Download history 27/week @ 2024-06-26 46/week @ 2024-07-03 44/week @ 2024-07-10 78/week @ 2024-07-17 142/week @ 2024-07-24 111/week @ 2024-07-31 90/week @ 2024-08-07 122/week @ 2024-08-14 118/week @ 2024-08-21 86/week @ 2024-08-28 127/week @ 2024-09-04 81/week @ 2024-09-11 494/week @ 2024-09-18 311/week @ 2024-09-25 83/week @ 2024-10-02 79/week @ 2024-10-09

975 downloads per month
Used in 9 crates (4 directly)

MIT/Apache

54KB
961 lines

Exhaust(ive iteration for Rust)

exhaust is a Rust library which provides the Exhaust trait, which can be used to iterate over all possible values of a type that implements it. Implementations are provided for standard library types, and derive macros are available to allow easy implementation for user-defined types.

Exhaustive iteration may be useful for exhaustive testing, working with enums, and solving constraints by brute-force search.

exhaust is no_std compatible with default features disabled. The alloc and std features add implementations for the corresponding standard library crates.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.7–1.1MB
~25K SLoC