Registry / utility / struct-iterable

struct-iterable

JSON →
library0.1.1rscratesunverified

A Rust library providing a proc macro to make a struct iterable.

# Cargo.toml [dependencies] struct_iterable = "0.1.1"
INSTALL
IMPORT
SIG · STRUCT-ITERABLE
S
struct-iterable
utilityrustv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Iterable
use struct_iterable::Iterable;

Derive Iterable on a struct and iterate over its fields.

use struct_iterable::Iterable; #[derive(Iterable)] struct MyStruct { field1: i32, field2: String, } fn main() { let s = MyStruct { field1: 42, field2: "hello".into() }; for (name, value) in s.iter() { println!("{}: {:?}", name, value); } }
Debug
Known issues
gotchaThe macro only works with named fields; tuple structs and enums are not supported.
fix
Use only structs with named fields.
affects: *
Upgrade
Version history
0.1.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
struct-iterable — cargo add struct-iterable · libregistry