forward-methods 0.0.2

A derive macro for forwarding methods from composed objects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod private {
    use forward_methods::fwd_pub;

    pub struct CompositeStruct(pub String);

    impl CompositeStruct {
        fwd_pub!(fn len(&self) -> usize to self.0);
    }
}

#[test]
fn should_forward_methods() {
    let cmp = private::CompositeStruct("hello, world!".to_string());

    println!("string len: {}", cmp.len())
}