Field iterator
Based on the abandoned struct_iterable. The rest of the README is taken from it.
This is meant as a lighter alternative to fields-iter.
How to Use
First, add the crate to your Cargo.toml:
[]
= "0.1.1"
Next, include the library at the top of your Rust file:
use Iterable;
Finally, add the #[derive(Iterable)] attribute to your struct:
Now, you can iterate over the fields of an instance of your struct:
let my_instance = MyStruct ;
for in my_instance.iter
Limitations
- Only structs with named fields are supported.
Contributing and License
If you're interested in contributing, please feel free to submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This crate is distributed under an MIT license.