[][src]Derive Macro unprolix::Setters

#[derive(Setters)]
{
    // Attributes available to this derive:
    #[unprolix]
}

Generate pub fn attribute(&mut self, v: T) { self.attribute = v; } functions for every non-public attribute.

Skip

To skip certain attributes that you don't want to expose, you can use #[unprolix(skip)]

Expansion

The following code

This example is not tested
#[derive(Setters)]
struct SomeStruct {
    a: u8,
    #[unprolix(skip)]
    b: u8,
}

Expands to

This example is not tested
impl SomeStruct {
    pub fn a(&mut self, v: u8) {
        self.a = v;
    }

    pub fn a_as_mut(&mut self) -> &mut u8 {
        &mut self.a
    }
}