[][src]Derive Macro unprolix::Getters

    // Attributes available to this derive:

Generate pub fn attribute(&self) -> Type { &self.attribute } functions for every non-public attribute.


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


If your type implements Copy and references are more expensive than copying, then you can use #[unprolix(copy)]

This is recommended for raw numbers or other simple types


Its not a good practice to pass vectors as references. For that, or any type that implements an T<S, ...> fn as_slice(&self) -> &[S], you can use #[unprolix(as_slice)]


The following code

This example is not tested
struct SomeStruct {
    a: HashMap<String, i32>,
    b: u8,
    c: u8,
    d: Vec<u8>,

Expands to

This example is not tested
impl SomeStruct {
    pub fn a(&self) -> &HashMap<String, i32> {

    pub fn b(&self) -> u8 {

    pub fn d(&self) -> &[u8] {