struct-convert 1.4.0

Auto Convert between structs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use struct_convert::Convert;

#[derive(Convert)]
#[convert(from_on = "remote::B")]
pub struct A {
    i: i64,
}

pub mod remote {
    pub struct B {
        pub i: i64,
    }
}

fn main() {
    let a = A { i: 0 };
    let _ = remote::B::from(a);
}