Procedural macros to derive std::convert::From
and std::convert::Into
implementations based on field/variant names.
The crate supports struct
s and enum
s only. union
s are not supported.
From
```rust
struct Point2D { x: i32, y: i32, }
struct Vec2D { x: i32, y: i32, }
let point = Point2D { x: 3, y: 4 };
let vector: Vec2D = point.into(); assert_eq!(vector, Vec2D { x: 3, y: 4 });
let point2: Point2D = vector.into(); assert_eq!(point2, Point2D { x: 3, y: 4 }); ```