derive_setters 0.1.9

Rust macro to automatically generates setter methods for a struct's fields.
Documentation
use derive_setters::Setters;

#[derive(Default, Setters)]
#[setters(generate_delegates(ty = "Other", field = "f", method = "m"))]
struct BothFieldAndMethod {
    a: u32,
}

struct Other {
    f: BothFieldAndMethod,
}

impl Other {
    fn m(&self) -> &BothFieldAndMethod {
        &self.f
    }
}

fn main() {}