VarIter
variter
is a Rust crate that exports some simple tools for iterating
over enum
types with zero or more variants that have no fields.
use ;
derive_var_iter!
If you're familiar with the Swift language, it's similar to using the
compiler-synthesized CaseIterable
protocol conformance.
See the module documentation for more information!
Usage
Add variter
as a dependency in your Cargo.toml
file:
[]
# ...
= "0.2"
Features
foreign_impls
(default): include implementions ofVarIter
on stablecore
types.std
(default): ifforeign_impls
is turned on,VarIter
implementations are included for stablestd
types.
no_std
Support
Given the simplicity of the crate, no_std
support can be toggled through the
default-features = false
flag in your Cargo.toml
dependency table.
[]
# ...
= { = "0.2", = false }
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.