Derive Macro wd_macro::ChainSet[][src]

#[derive(ChainSet)]
Expand description

为结构体字段添加链式set方法

#[derive(ChainSet)]
struct Hello{
    name:String,
}
#[test]
fn test_macro(){
    let name = "hello".to_string();
    let hello = Hello{name};
    let hello = hello.cset_name("world".to_string());
    println!("hello {}",hello.name)
}